Name a variabile with the value of another variable

Viewed 35

Suppose I have a variable:

x <- "Cat"

This variable x must define the name of another variable"

[x] <- c(1,2,3)

that is, in this example:

Cat <- c(1,2,3)

Any tip?

1 Answers

Here.

x <- "cat"

assign(x = x, value = 1:3)
Related