With chartSeries you can set the layout argument to NULL so you don't have to call the layout() command: this is what disables the mfrow parameter.
library(quantmod) getSymbols("AA") op <- par(mfrow=c(3,2)) for(i in 1:6) { chartSeries( AA["2011-01"], "candlesticks", TA=NULL, # No volume plot layout=NULL, yrange=c(15,18) ) } par(op)
If you want to save the volume, you can call layout instead of installing mfrow : it does basically the same thing, but allows you to have graphs of different sizes and choose the order in which they are displayed.
layout( matrix( c( 1, 3, 2, 4, 5, 7, 6, 8, 9, 11, 10, 12 ), nc=2, byrow=TRUE), heights = rep( c(2,1), 3 ) ) #layout.show(12) # To check that the order is as desired for(i in 1:6) { chartSeries( AA[sprintf("2011-%02d",i)], "candlesticks", layout=NULL, yrange=c(15,19) ) }
Vincent zoonekynd
source share