Zachary Donnini
Zachary Donnini

Reputation: 39

Variable to Text

Let's say I have a variable "chicago" which is currently 30.

chicago <- 30

I also have a text string variable "a" which is currently "chicago".

   a <- "chicago"

How can I store another number (say 40) to "a" and make it save to chicago.

Upvotes: 0

Views: 32

Answers (1)

mickey
mickey

Reputation: 2188

You're looking for the assign function:

chicago = 30
a = "chicago"

assign(a, 40) 
chicago
# 40

Upvotes: 1

Related Questions