I have an assignment for stat computing, and now I get stuck on something you all probably think pretty easy, I won't ask you to solve the whole thing for me, however this is the problem:
I have a data frame with multiple columns I need to slip these columns into two I know how to slipt one column, in this case column three:
strsplit((my_data[,3]), split = " ")
however if I try to do this over al the column I need this for:
strsplit((my_data[,3:14]), split = " ")
I get this error: Error in strsplit((my_data[, 3:14]), split = " ") : non-character argument
So I understand I probably need a loop, however I don't know how to do this, this is what I tried:
test <- for(i in 3:ncol(my_data)){
strsplit((my_data[i]), split = " ")
}
but yeah that doesn't work
enter code here