SyntaxFix
Write A Post
Hire A Developer
Questions
Here is how the remove the last element of a list in R:
x <- list("a", "b", "c", "d", "e") x[length(x)] <- NULL
If x might be a vector then you would need to create a new object:
x <- c("a", "b", "c", "d", "e") x <- x[-length(x)]