R/frameAutoSize.R

Defines functions frameAutoSize

frameAutoSize <-
function(width,height,fdc){ 
  if(is.null(width)==TRUE&&is.null(height)==TRUE){
    width <- 10
    height<-23*width*(bbox(fdc)[2]-bbox(fdc)[4])/(bbox(fdc)[1]-bbox(fdc)[3])/20
  }else{
    if(is.null(width)==FALSE&&is.null(height)==TRUE){
      height<-23*width*(bbox(fdc)[2]-bbox(fdc)[4])/(bbox(fdc)[1]-bbox(fdc)[3])/20
    }else{
      if(is.null(width)==TRUE&&is.null(height)==FALSE){
        width<-17*height*(bbox(fdc)[1]-bbox(fdc)[3])/(bbox(fdc)[2]-bbox(fdc)[4])/20
      }
    }
  }
  dimFrame <- c(width,height)
  return(dimFrame)
}

Try the rCarto package in your browser

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

rCarto documentation built on May 2, 2019, 8:20 a.m.