temporarily modify par values?
Gabor Grothendieck <ggrothendieck at gmail.com> writes:
Here is a minor variation:
par <- function( ... ) structure( graphics::par( ... ), class = "par" )
with.par <- function( data, expr, ... ) {
on.exit(par(old.par, no.readonly = TRUE))
old.par <- data
invisible(expr)
}
which returns expr invisibly so that this works:
bp <- with(par(mar = c(4, 1, 1, 1)), boxplot(1:10))
Thank you very much, that looks like a better way of cleaning up with an error too than my attempt. Yours sincerely,
Jim Ottaway