I have a list, one element of which is shown below
[[1]]
[[1]]$`id`
[1] "id"
[[1]]$num
[1] 100
To extract all the "num" elements from the list, I can use the following
nums=laply(x,`[[`,2)
Is there any way to replace the 2 in the laply expression with something like $num?