[R] help with vector construction
Greg.Snow at intermountainmail.org
Thu Jul 5 22:07:47 CEST 2007
One approach is to use the fact that vectors are automatically
replicated to the correct length when subscripting, so you can do
> my.matrix[ c(FALSE,TRUE,FALSE), 3 ]
To get every 3rd element starting at the 2nd element, and the 3rd
Hope this helps,
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at intermountainmail.org
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Juan
> Pablo Fededa
> Sent: Thursday, July 05, 2007 11:30 AM
> To: r-help at stat.math.ethz.ch
> 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]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help