When run the following code, I obtain Error in as.graphicsAnnot(text) : could not find function "bold"
. How can I fix this?
my.qq <- function(x, main=expression(bold(italic(F)~~"Q-Q plot")),
margs=list(side=3, cex=par("cex.main"), font=par("font.main"),
adj=par("adj"), xpd=NA), ...)
{
plot(qnorm(ppoints(n <- length(x))), sort(x), ...)
do.call(mtext, c(list(main), margs))
}
x <- rnorm(100)
my.qq(x)
my.qq(x, main=substitute(bold(italic(F)[N(mu.,s2.)]~~"Q-Q plot"), list(mu.=0, s2.=1))) # fails
My goal is to use the list margs
to pass additional arguments to mtext()
. That's normally done with ...
, but those arguments are already passed to plot()
.