# NOT RUN {
len <- 100 # number elements in list
lis <- lapply(1:len, function(l) list(x=(-l), y=l^2) ) # create list
getListElement(lis, "x")[1] # should be equal to -1
getListElement(lis, 1)[1] # should be equal to -1
# }
Run the code above in your browser using DataLab