0

I've got a list named rec containing dataframes of participant1 to participant17 and should check the number of columns in every single dataframe. This is how I tried it:

columns = rep(NA, length(1:17))
v1 = seq(1:17)
for (i in v1) {
    columns = length(rec$participant[i])  
}

Unfortunately R just returns 0 for columns and I would be happy about for any help.

reduckted
  • 2,358
  • 3
  • 28
  • 37
oelmel
  • 13
  • 3
  • Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap Apr 02 '16 at 10:21
  • Just use lapply or sapply . You will accomplish that in one line – R.S. Apr 02 '16 at 10:31
  • Thank you very much, now I got it! – oelmel Apr 02 '16 at 11:46

0 Answers0