When subsetting a data.frame inside of a list, I get vectors instead of a data.frames (see the example below). How to avoid this and get a data.frames?
> res <- lapply(l, function(x) x[2:nrow(x),, drop=FALSE])
> sapply(res,class)
A B C
"data.frame" "data.frame" "data.frame"
> res
$A
a
2 2
3 3
$B
b
2 5
3 6
4 5
$C
c
2 4
3 5
4 6