I'm trying to find the opposite of obtain ().
I want to immediately extract the character string that corresponds to an item based on its name.
Simple illustration using foo as a stand-in for the function I'm looking for.
Z is equal to data.frame(x=1:10, y=1:10).
function(a) test
Mean(a$x) = mean.x
print(foo(a))
return(mean.x)}
test(z)
If printed:
"z"
My solution, which is more difficult to put into practise in my current issue, is:
function(a="z") test
Mean(get(a)$x) = mean.x
print(a)
return(mean.x)}
test("z")