Displaying 1 result from an estimated 1 matches for "answer_2".
Did you mean:
answer2
2006 Jul 24
1
Referring on the value of a counter in a loop
...ver "class", replacing the occurences of
"1" in the code above successively with the integers from 1 to 78, so
that I get my 78 files.
(equivalent to typing:
k_1<-answer[class==1]
write.table(k_1, "answer_1.txt")
k_2<-answer[class==2]
write.table(k_2, "answer_2.txt")
etc.)
I have tried
for (i in 1:78) k_i<-answer[class==(i)]
but this only generated the variable corresponding to the last value
(78) of the counter i, and not the files in between.
Thanks a lot for any help or pointers in the right direction. I am an
R beginner and I studied...