R/adjust.R

Defines functions adjust

Documented in adjust

#' adjustment of tableplot object, to be implemented in tabplot itself
#' @keywords internal 
adjust <- function(tp){
  atp <- list()
  varnms <- sapply(tp$columns, function(i) i$name)
  vars <- lapply( tp$columns
                  , function(i) { 
                       if (i$isnumeric){
                         return(list( mean = i$mean
                                 , compl = i$compl/100
                               ))
                       }
                      list( freq = i$freq, palet=i$palet, categories=i$categories)                
                    }
                )
  names(vars) <- varnms
  atp$vars <- vars
#   atp$dataset <- tp$dataset
  atp$sortCol = names(tp$columns)[tp$sortCol]
  atp$nBins <- tp$nBins
  atp
}

Try the tabplotd3 package in your browser

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

tabplotd3 documentation built on May 30, 2017, 6:29 a.m.