Some datas :
reslist <- list()
reslist <- append(reslist,list(c(1,2,3,4)))
names(reslist) <- "name1"
reslist <- append(reslist,list(c(3,4,1,0)))
How to name only the last element of the list ? My actual list is of variable length, so I dont know the indice of the last element.
names(reslist[[length(reslist)]]) <- "name2"
Doesn’t work as the first name (names(reslist) <- “name1”), why ?
You’re just indexing the wrong thing. Try this: