R/TableProfiler-R6.R

#' @title Generate a Table Profile
#'
#' @description Given \code{table}, when
#'   \code{TableProfiler$new(table)} is called, then a list with that
#'   table attributes is generated and returned.
#'
#' @return (`TableProfiler`) An object with the table profile.
#'
#' @export
#'
#' @examples
#' \dontrun{
#' mtcars_profiler <- TableProfiler$new(mtcars)
#' mtcars_profiler$profile
#' }
#'
TableProfiler <- R6::R6Class(
    classname = "TableProfiler",
    public = list(
        ## Public Methods
        initialize = function(table){
            stopifnot(table %>% missing() %>% isFALSE())
            private$.profile <- private$.generate_table_profile(table)
        }
    ),
    private = list(
        ## Private Variables
        .profile = list(),
        ## Private Methods
        .generate_table_profile = function(.data) generate_table_profile(.data)
    ),
    active = list(profile = function() return(private$.profile))
)# end R6
tidylab/tidylab.dqa documentation built on June 21, 2019, 7 p.m.