Get Name of Data Object as Character String in R (Example Code)

This article shows how to return the name of a data object as character string in the R programming language.

Creation of Exemplifying Data

example_variable <- 555                  # Constructing data object in R

Example: Converting Data Object’s Name to Character String

deparse(substitute(example_variable))    # Using deparse() & substitute()
# [1] "example_variable"

Related Tutorials & Further Resources

Have a look at the following list of R tutorials. They discuss topics such as factors, character strings, data objects, and lines.

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