Convert Character String to Variable Name in R (2 Examples) | assign & do.call Functions Explained

Опубликовано: 10 Февраль 2025
на канале: Statistics Globe
2,781
14

How to turn a character string into a variable name in the R programming language. More details: https://statisticsglobe.com/convert-c...
R code of this video:

##### Example 1

assign("my_string_1", 1:5) # Apply assign function

my_string_1 # Return variable values


##### Example 2

do.call("<-", list("my_string_2", 1:5)) # Apply do.call function

my_string_2 # Return variable values