I would like to use the same arguments for several calls to plot
.
I tried to use a list (which can serve as a dictionary) :
a <- list(type="o",ylab="")
plot(x,y, a)
But it does not work :
Error in plot.xy(xy, type, ...) : invalid plot type
Any suggestion ?
Extending @baptiste's answer, you can use do.call
like this:
x <- 1:10 # some data
y <- 10:1
do.call("plot", list(x,y, type="o", ylab=""))
Or setting the arguments in a list and call it a
a <- list(x,y, type="o", ylab="")
do.call(plot, a)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With