You can use deparse
and substitute
to get the name of a function argument:
myfunc <- function(v1) {
deparse(substitute(v1))
}
myfunc(foo)
[1] "foo"
More Related Contents:
- Convert string to a variable name
- Making a string concatenation operator in R
- Removing html tags from a string in R
- How to split a string into substrings of a given length? [duplicate]
- Load R package from character string
- Getting and removing the first character of a string
- pass character strings to ggplot2 within a function
- Insert a character at a specific location in a string
- Convert R vector to string vector of 1 element [duplicate]
- as.numeric with comma decimal separators?
- Count word occurrences in R
- converting datetime string to POSIXct date/time format in R
- Extract numeric part of strings of mixed numbers and characters in R
- Use character string as function argument
- How can I remove repeated characters in a string with R?
- How to collapse a list of characters into a single string in R
- Split a character vector into individual characters? (opposite of paste or stringr::str_c)
- Repeat and concatenate a string N times
- Extract the first (or last) n characters of a string
- Insert line breaks in long string — word wrap
- How to combine multiple character columns into a single column in an R data frame
- Ignore escape characters (backslashes) in R strings
- What’s the difference of strings within single or double quotes in groovy?
- Difference between text and varchar (character varying)
- Does xslt have split() function?
- Select rows from data.frame ending with a specific character string in R
- Is there a function to split a string in Oracle PL/SQL?
- Line continuation of strings in Fortran
- What is the difference between VBScript’s + and & operator?
- Split a string column into several dummy variables