I try to read out certain elements from a list in a way, thats equivalent to df[, c(1,4,5)] in a data.frame.
df[, c(1,4,5)]
data.frame
> obj <- list(c(1:5)
You should call lapply with a function which is run on every list entry:
obj <- list(c(1:5), c(1:5)) lapply(obj, function(x) x[c(1, 4, 5)]) #[[1]] [1] 1 4 5 [[2]] [1] 1 4 5