How to Apply the assign() Function in R (Example Code)
In this article you’ll learn how to apply the assign function() in the R programming language.
Example: Basic Application of assign() Function in R
assign(x = "new_variable", # Specifying variable name value = letters[1:10]) # Values to be stored in variable |
assign(x = "new_variable", # Specifying variable name value = letters[1:10]) # Values to be stored in variable
new_variable # Returning output # [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" |
new_variable # Returning output # [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"