How to store the output of a for loop into a csv file in R? -


i've couple of loops:

for (i in 1:length(v1)) {     v2[i] <- subset(file1, srl == v1[i], flrgrp) } 

and

for(i in 1:length(v1)) {   print(v1[i])   print(v2[i]) } 

and v1[] vector of numbers..

now output of second loop follows:

[1] 789 [[1]] [1] pg        d115    d06    slz 27 levels:  dd d004 d010 d022 d023 d103 d108 d113 d115 d211 d214 ... slz  [1] 787 [[1]] [1] d010           hs/cn 27 levels:  dd d004 d010 d022 d023 d103 d108 d113 d115 d211 d214 ... slz  [1] 949 [[1]] [1] hs/cn d06           27 levels:  dd d004 d010 d022 d023 d103 d108 d113 d115 d211 d214 ... slz 

now want create csv file using write.csv file output stored follows:

srl flrgrp 789 pg,d115,d06,slz 787 d010,hs/cn 949 hs/cn,d010 

how achieve in r using write.csv or more helpful?? (please note i'm trying not include message says every time - 27 levels: dd d004 d010 d022 d023 d103 d108 d113 d115 d211 d214 ... slz


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -