Hi, I have a matrix that has a variable number of columns. I do not know, a priori, the number of columns. How can I get a sub matrix, for example, from row 10 to the end of the columns? In MatLab I would use something like this: SubMatrix = Matrix[10, 1:end] Thanks a lot. -- View this message in context: http://www.nabble.com/Get-data-from-matrix-tf4629336.html#a13218653 Sent from the R help mailing list archive at Nabble.com.
Hi, mat[,10:ncol(mat)] On 15/10/2007, pintinho <diego@bpgomes.com> wrote:> > > Hi, > > I have a matrix that has a variable number of columns. I do not know, a > priori, the number of columns. > > How can I get a sub matrix, for example, from row 10 to the end of the > columns? > > In MatLab I would use something like this: SubMatrix = Matrix[10, 1:end] > > Thanks a lot. > -- > View this message in context: > http://www.nabble.com/Get-data-from-matrix-tf4629336.html#a13218653 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
SubMatrix = Matrix[10,] Cheers, Jorge ----- Original Message ----- From: pintinho <diego at bpgomes.com> Date: Monday, October 15, 2007 2:17 pm Subject: [R] Get data from matrix> > Hi, > > I have a matrix that has a variable number of columns. I do not > know, a > priori, the number of columns. > > How can I get a sub matrix, for example, from row 10 to the end of the > columns? > > In MatLab I would use something like this: SubMatrix = Matrix[10, > 1:end] > Thanks a lot. > -- > View this message in context: http://www.nabble.com/Get-data-from- > matrix-tf4629336.html#a13218653 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.htmland provide commented, minimal, self-contained, > reproducible code. >