string2varname: string2varname

Description Usage Arguments Value Examples

View source: R/strings.R

Description

This function takes a string and turns it into a variable name. Code from John Ramey at http://johnramey.net/blog/2010/12/28/converting-a-string-to-a-variable-name-on-the-fly-and-vice-versa-in-r/

Usage

1

Arguments

x

string

Value

value of variable with name equal to the string

Examples

1
2
3
x <- 42
eval(parse(text = "x"))
# [1] 42

smach/rmiscutils documentation built on Dec. 15, 2021, 1:49 a.m.