if(requireNamespace('graphics', quietly = TRUE)) {
angle = 1:10
variable <- as.name("angle")
plotb <- bquote_function(graphics::plot)
plotb(x = .(variable), y = sin(.(variable)))
}
f1 <- function(x) { substitute(x) }
f2 <- bquote_function(f1)
arg <- "USER_ARG"
f2(arg) # returns arg
f2(.(arg)) # returns "USER_ARG" (character)
f2(.(-arg)) # returns USER_ARG (name)
Run the code above in your browser using DataLab