x <- list("item one", "item two", "item three")
If I wanted to select all but the last item in Python, I would use x[:-1]. How do I do this in R?
x <- list("item one", "item two", "item three")
If I wanted to select all but the last item in Python, I would use x[:-1]. How do I do this in R?
We can tell R to take one less than the length of the entire vector: x[1:length(x)-1]