How do I use MoreArgs properly with chart_Series?
p.txt
s,n
ABBV,AbbVie
BMY,Bristol
LLY,EliLily
MRK,Merck
PFE,Pfizer
sof.r
# R --silent --vanilla < sof.r
library(quantmod)
options("getSymbols.warning4.0"=FALSE)
options("getSymbols.yahoo.warning"=FALSE)
# setup chart params
cp <- chart_pars()
cp$cex=0.55
cp$mar=c(1,1,0,0) # B,L,T,R
# setup chart theme
ct <- chart_theme()
ct$format.labels <- ' ' # AG: space needed to remove bottom x-axis labels
ct$lylab <- TRUE # AG: enable left y-axis labels
ct$rylab <- FALSE # AG: remove right y-axis labels
ct$grid.ticks.lwd=1
# read values into vectors
csv <- read.csv("p.txt", stringsAsFactors = FALSE)
symVec <- getSymbols(as.vector(csv$s))
infoVec <- mapply(paste, csv$s, csv$n, sep=": ") # eg. SYM: Name
cpVec = rep(cp, times=nrow(csv))
# create PDF
pdf(file = "p.pdf")
par(mfrow = c( 5, 4 ) )
mapply (chart_Series, mget(symVec), name=infoVec, null, null, null, MoreArgs=cp, MoreArgs=ct)
dev.off()
Error
> mapply (chart_Series, mget(symVec), name=infoVec, null, null, null, MoreArgs=cp, MoreArgs=ct)
Error in mapply(chart_Series, mget(symVec), name = infoVec, null, null, :
formal argument "MoreArgs" matched by multiple actual arguments
Execution halted