a function to take a list and get a particular part out of each element in the list
Examples
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
#> [[1]]
#> [1] -1
#>
getListElement(lis, 1)[1] # should be equal to -1
#> [[1]]
#> [1] -1
#>