[R] assigning vector name by increasing index in loop

cbc123 charliebcooper at gmail.com
Thu Jul 9 16:11:23 CEST 2009


Hello

I have a large data table that I wish to divide in to vectors, as in 
         v1     v2     v3     v4     v5
id1    1       2      3        4       5
id2    6      7       8       9      10

newv1 <- c(table[1,1], table[3,1], table [5,1])
newv2<-c(table[1,2], table[3,2]. table[5,2])

...and so forth.  How do I do this using a loop?
-- 
View this message in context: http://www.nabble.com/assigning-vector-name-by-increasing-index-in-loop-tp24410532p24410532.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list