I have a list and I want to remove a single element from it. How can I do this?
I\'ve tried looking up what I think the obvious names for this function would be in
You can also negatively index from a list using the extract function of the magrittr package to remove a list item.
extract
magrittr
a <- seq(1,5) b <- seq(2,6) c <- seq(3,7) l <- list(a,b,c) library(magrittr) extract(l,-1) #simple one-function method [[1]] [1] 2 3 4 5 6 [[2]] [1] 3 4 5 6 7