Leute!!

Suppose you have a list of 20 dataframes, each of data frame has 10 columns but different rows. You want to know the length of rows in each dataframe without using loop in a single line.

sapply(x,function(y)length(y[[1]]))

where x is a list

If you are after a specific column, just replace the number [[1]] with it.

Cheers

Sukhi

  1. sukhdeepsingh posted this