R/figNewDevice.R

figNewDevice <- function(Width=7,Height=7, Type='window', File, Res=300)
  #opens a graphical device.  If figure parameters are not set in options, sets 
  #them to our lab's defaults.
{
  #set up options for default figure parameters
  if(is.null(getOption('FigPars'))) 
  {
    FigPars = figLabDefaults()
    figSetDefaults(FigPars)
  }else
  {
    FigPars = options('FigPars')
  }

  switch(toupper(Type),
  WINDOW = 
  {
    dev.new(height=Height, width=Width, noRStudioGD=TRUE)
  },
  PDF =
  {
    pdf(file=File,width=Width, height=Height)
  },

  TIFF =
  {
    tiff(filename=File, width=Width,height=Height, res=Res, units='in')
  }
  )  #end switch
  par(FigPars$xpd)
}

Try the lmSupport package in your browser

Any scripts or data that you put into this service are public.

lmSupport documentation built on May 2, 2019, 2:14 p.m.