Skip to content
Prev 176082 / 398503 Next

temporarily modify par values?

Jim Ottaway wrote:
Hi,

"with" is generic, so you could do something like that:

 > par <- function( ... ) structure( graphics::par( ... ), class = "par" )
 > with.par <- function( data, expr, ... ){
+    old.par <- data
+    expr
+    invisible( par( old.par ) )
+ }
 > with( par( mar = c(0,0,0,0) ), plot( 1:10, 1:10 ) )
 > plot( 1:10, 1:10)

Romain