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
new_variable                     # Returning output
#  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top