I have a list of data frames. I'd like to extract the first 248 rows of every data frame, then bind them together into one single data frame.
allData is the list of data frames. I've tried to use lapply with subset but I don't know how to refer to row numbers in there. It seems the "subset" argument of the subset function only accept logical vector.
temp <- lapply(allData, subset, subset = (row.names(allData) <= 248))
This code is my idea which does not work, because row.names(allData) actually only applies to the list itself, not the data frames. How to refer to the row numbers of each data frame then?