I have a list with several tibbles comprising several columns; and I want to remove the first 2 columns in each tibble (not using for loop).
#Example data with tibble and list
w <- c(1, 2, 3, 4, 5)
x <- c(1, 2, 3, 4, 5)
y <- c(1, 2, 3, 4, 5)
z <- c(1, 2, 3, 4, 5)
tibble <- tibble(w, x, y, z)
list <- list(tibble, tibble, tibble, tibble)
#Remove the first 2 columns in the tibble
tibble1 <- subset(tibble, select=-c(1:2))
tibble1
#Tried this to remove the first two columns of each tibble in list
list1 <- sapply(list, FUN = function(x) subset(x, select=-c(1:2)) )
list1