I\'m new on R language and I still have a lot to learn. I\'ve a list W of J elements and I would like to rename its elements W[[i]] with Wi>
W
W[[i]]
Wi>
A purrr solution using @Quentin's data:
purrr
library(purrr) w <- list(a = "give", b = "me an", c = "example") %>% set_names(~paste0("W", 1:length(w))) w # $W1 # [1] "give" # $W2 # [1] "me an" # $W3 # [1] "example"