0

In reference to this question, the top answer gives a solution to change the element of the list. I am wondering if there is a way to rename the list's "names" after they have already been defined. As a small example:

> a <- list(1, 2, 3)
> names(a) <- c('A','B',"C")

> a
$A
[1] 1

$B
[1] 2

$C
[1] 3

> names(a[1]) <- 'D' #does not work
> a
$A
[1] "test1"

$B
[1] "test2"

$C
[1] "test3"

How can I rename the names here?

Kyle Weise
  • 869
  • 1
  • 8
  • 29

0 Answers0