I want to get the input parameter of a function to create an output with the same prefix in the global env
fun_mtcars <- function(name_ref,...){
df <- name_ref %>%
select(mpg,...)
.GlobalEnv$selec_name_ref <- df
}
fun_mtcars(mtcars,disp)
In global env a new data frame was created with the name "selec_name_ref " but I want a name "selec_mtcars"
I can do selec_mtcars <- fun_mtcars(mtcars,disp)
but I have a lot of function to execute