[R] Breakdown of Vector

Rajasekaramya ramya.victory at gmail.com
Fri Nov 21 16:48:09 CET 2008


Hi,

I have a vector of Size 7420. I wanna break down in such a way that every 20
elements of it should be as elements of an list.

Ex
EXAM1
ABC, SDF, LMN,ERF,EGC,EFG,WER,FRE,QWE,ERT,DGW,QWE,YUR,ERT,GHJ,FHH,....7420

what i want is 
Breakdown.list
[[1]]
ABC,SDF,.....20
[[2]]
21.....40
[[3]]
41....50

i thought of using a for loop but i am wondering how to incerment
test.breakdown.list<-list()
for( i =0;i<=length(EXAM1);i+20)
{
test.breakdown.list<-Exam1[c(i:i+20)]
print (paste(i))
}

Ias this how we do...please correct me if am wrong.

Regards
Ramya


-- 
View this message in context: http://www.nabble.com/Breakdown-of-Vector-tp20623764p20623764.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list