Hello, I would like to iterate through a table and break it into relvant parts based on the number of visits. I have tried several things but cannot seem to get it to work.
I have included the code.
for(i in 1:6){
paste("testing.visit",i,"\n",sep="") <- subset(testing,visit_no==2)
}
But I get the following error.
Error in paste("testing.visit", i, "\n", sep = "") <- subset(testing, :
target of assignment expands to non-language object
Thank you,
Brandon