One approach is to use the fact that vectors are automatically replicated to the correct length when subscripting, so you can do something like:
> my.matrix[ c(FALSE,TRUE,FALSE), 3 ] To get every 3rd element starting at the 2nd element, and the 3rd column. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Juan > Pablo Fededa > Sent: Thursday, July 05, 2007 11:30 AM > To: [email protected] > Subject: [R] help with vector construction > > Hi all, > > I want to make a vector with the third column of a matrix, > but only for the > 2+3n rows of the matrix, with n being an entire number from 0 > to a million. > How can I do that in an easy way? > Thanks in advance, > > Juan Pablo > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] 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. > ______________________________________________ [email protected] 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.
