I'm having trouble with something simple and need some help.
I'm writing a function that should print the name of the object but can't seem to get it to work.
The issue I'm having is that I can't get the name of the object printed inside of the function.
See code below:
func_ <- function(x) {
print(quote(x))
}
func_(mtcars)
The result of this function is "x" and not "mtcars".
How do I change the function to print "mtcars" or the name of any other object that I pass to x?