I have a variable:
Person1 = "friend"
That I save in a second variable, namely:
Real_friend = Person1
Is it possible to have a function like this:
output <- myfunc(Real_friend)
myfunc <- function(v1) {
# do something with v1
# so that it prints "Person1" when
# this function is called
#
# instead of "friend"
return ()
}
output = "Person1"
I have tried to apply the method: deparse(substitute(v1)) suggested here:
How to convert variable (object) name into String
but it does not seem to work. Thanks so much in advance