Created
July 25, 2013 19:39
-
-
Save lauratboyer/6083050 to your computer and use it in GitHub Desktop.
Looks at current graphic device size, if it's not the specified width and height closes it and opens a new one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check.dev.size <- function(ww,hh) { | |
if(dev.cur()==1){ dev.new(width=ww,height=hh) | |
} else { | |
ds <- dev.size() | |
if(round(ds[1],2)!=round(ww,2) | |
| round(ds[2],2)!=round(hh,2)) { | |
dev.off(); dev.new(width=ww,height=hh)} } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment