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>
names(W) <- paste0("W", seq_along(W))
should do the trick.
Note that paste0 was introduced in R 2.15 as a "slightly more efficient" version of paste(..., sep = "", collapse) . If you are using an earlier version of R, you can achieve the same using paste:
names(W) <- paste("W", seq_along(W), sep = "")