lapply(X, FUN, ...)
#apply mean function with trim argument to each element of list x lapply(x, mean, trim=.1)# apply mean to the stack.loss data with various values of trim lapply(list(0, .05, .1, .25, .5), mean, x=stack.loss)
l <- as.list(1:5)
# generate a list with elements 1, 1:2, 1:3, ... lapply(l,seq)
#generate a list with elements 1, c(2, 2), c(3, 3, 3), ... lapply(l, function(x)rep(x,x))