Data Summaries in R

Author

Wade K. Copeland

Published

October 15, 2025

Introduction

An essential part of any data analysis project is to understand the data at hand. For this task, we will create a function that takes as input a variable from the data, a categorical variable to describe by, and returns summary tables and plots.

This tutorial uses the R programming language (R Core Team 2019). All of the files needed to reproduce these results can be downloaded from the Git repository https://github.com/wkingc/data-summaries-r.

Required Libraries

The libraries knitr, bookdown, and kableExtra are used to generate the HTML output (Xie 2019, 2018; Zhu 2019). The ggplot2 library is loaded for the example data set that is used in this tutorial (Wickham 2016). The Hmisc library provides functionality needed to create variable labels (Harrell Jr, Charles Dupont, and others. 2019). The libraries reshape2 and dplyr are loaded for their data manipulation funtions (Wickham et al. 2019; Wickham 2007).

library("knitr")
library("bookdown")
library("kableExtra")
library("ggplot2")
library("Hmisc")
library("reshape2")
library("dplyr")

Example Data Setup

The data set used in this tutorial is mpg from the ggplot2 package. From the description in the manual:

This dataset contains a subset of the fuel economy data that the EPA makes available here. It contains only models which had a new release every year between 1999 and 2008 - this was used as a proxy for the popularity of the car.

set.seed(123)
data(mpg)
mpg <- data.frame(mpg)

colnames(mpg)[which(colnames(mpg) == "manufacturer")] <- "manu"

mpg$manu <- factor(mpg$manu)
mpg$model <- factor(mpg$model)
mpg$displ <- as.numeric(mpg$displ)
mpg$year <- factor(mpg$year, levels = c("1999", "2008"), ordered = TRUE)

mpg$dp <- as.Date(NA, origin = "1970-01-01")
mpg$dp[which(mpg$year == "1999")] <- sample(seq(as.Date('1999-01-01', format = "%Y-%m-%d", origin = "1970-01-01"), as.Date('1999-12-25', format = "%Y-%m-%d", origin = "1970-01-01"), by="day"), dim(mpg)[1]/2)
mpg$dp[which(mpg$year == "2008")] <- sample(seq(as.Date('2008-01-01', format = "%Y-%m-%d", origin = "1970-01-01"), as.Date('2008-12-25', format = "%Y-%m-%d", origin = "1970-01-01"), by="day"), dim(mpg)[1]/2)
mpg$dp[sample(1:length(mpg$dp), size = 20)] <- NA
mpg$dp[10] <- as.Date('1000-05-02', format = "%Y-%m-%d", origin = "1970-01-01")

mpg$dplt <- as.POSIXlt(NA, origin = "1970-01-01 0:0:0")
mpg$dplt[which(mpg$year == "1999")] <- sample(seq(as.POSIXlt('1999-01-01 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), as.POSIXlt('1999-12-25 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), by="min"), dim(mpg)[1]/2)
mpg$dplt[which(mpg$year == "2008")] <- sample(seq(as.POSIXlt('2008-01-01 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), as.POSIXlt('2008-12-25 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), by="sec"), dim(mpg)[1]/2)
mpg$dplt[sample(1:length(mpg$dplt), size = 20)] <- NA

mpg$dpct <- as.POSIXct(NA, origin = "1970-01-01 0:0:0")
mpg$dpct[which(mpg$year == "1999")] <- sample(seq(as.POSIXct('1999-01-01 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), as.POSIXct('1999-12-25 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), by="min"), dim(mpg)[1]/2)
mpg$dpct[which(mpg$year == "2008")] <- sample(seq(as.POSIXct('2008-01-01 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), as.POSIXct('2008-12-25 0:0:0', format = "%Y-%m-%d %H:%M:%S", origin = "1970-01-01 0:0:0"), by="sec"), dim(mpg)[1]/2)
mpg$dpct[sample(1:length(mpg$dpct), size = 20)] <- NA

mpg$cyl <- factor(mpg$cyl, levels = c(4, 5, 6, 8), ordered = TRUE)

mpg$trans <- factor(mpg$trans)
mpg$drv <- factor(mpg$drv, levels = c("f", "r", "4"), labels = c("front-wheel drive", "rear wheel drive", "4wd"))
mpg$fl <- factor(mpg$fl)
mpg$class <- factor(mpg$class)

mpg$rn <- rnorm(dim(mpg)[1], mean = 10, sd = 5)
mpg$rn[sample(1:length(mpg$rn), size = 50)] <- NA

mpg$rdifftime <- rnorm(dim(mpg)[1], mean = 10, sd = 5)
mpg$rdifftime[sample(1:length(mpg$rdifftime), size = 50)] <- NA
mpg$rdifftime <- as.difftime(mpg$rdifftime, units = "weeks")
mpg$rdifftime[which(mpg$rdifftime < 0)] <- 0

mpg$logical <- mpg$rdifftime >= 10

mpg$party <- factor(sample(c("republican", "democrat", "independent", NA), dim(mpg)[1], replace = TRUE), levels = c("republican", "democrat", "independent"))

mpg$comments <- sample(c("I like this car!", "Meh.", "This is the worst car ever!", "Does it come in green?", "want cheese flavoured cars.", "Does it also fly?", "Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah", "Missing", ".", NA), dim(mpg)[1], replace = TRUE)

mpg$miss <- NA

label(mpg$manu) <- "manufacturer"
label(mpg$model) <- "model name"
label(mpg$displ) <- "engine displacement, in litres"
label(mpg$year) <- "year of manufacture"
label(mpg$dp) <- "date of purchase (Date class)"
label(mpg$dplt) <- "date of purchase (POSIXlt class)"
label(mpg$dpct) <- "date of purchase (POSIXct class)"
label(mpg$cyl) <- "number of cylinders"
label(mpg$trans) <- "type of transmission"
label(mpg$drv) <- "drive type"
label(mpg$cty) <- "city miles per gallon"
label(mpg$hwy) <- "highway miles per gallon"
label(mpg$fl) <- "fuel type"
label(mpg$class) <- "type of car"
label(mpg$rn) <- "some random numbers that are generated from a normal distrubtion with mean = 10 and sd = 5"
label(mpg$rdifftime) <- "some random numbers that are generated from a normal distrubtion with mean = 10 and sd = 5, and then converted to weeks"
label(mpg$logical) <- "some random numbers that are generated from a normal distrubtion with mean = 10 and sd = 5, and then converted to weeks, and then set to TRUE if the difference is greater than 10"
label(mpg$party) <- "some random political parties"
label(mpg$comments) <- "some random comments"
label(mpg$miss) <- "an all missing variable"

kable(head(mpg), caption = "Header of <b>mpg</b>.", booktabs = TRUE, escape = FALSE) %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))
Header of mpg.
manu model displ year cyl trans drv cty hwy fl class dp dplt dpct rn rdifftime logical party comments miss
audi a4 1.8 1999 4 auto(l5) front-wheel drive 18 29 p compact 1999-06-28 1999-10-07 08:18:00 1999-10-27 08:00:00 8.935759 9.675375 weeks FALSE NA Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah NA
audi a4 1.8 1999 4 manual(m5) front-wheel drive 21 29 p compact 1999-01-14 1999-04-28 07:00:00 1999-01-25 04:26:00 9.531816 13.782912 weeks TRUE democrat Does it also fly? NA
audi a4 2.0 2008 4 manual(m6) front-wheel drive 20 31 p compact 2008-02-08 2008-05-04 14:32:00 2008-01-06 09:57:35 9.566429 4.928852 weeks FALSE independent . NA
audi a4 2.0 2008 4 auto(av) front-wheel drive 21 30 p compact 2008-07-14 2008-02-11 12:43:49 2008-01-30 06:40:31 17.207309 6.539646 weeks FALSE democrat Does it come in green? NA
audi a4 2.8 1999 6 auto(l5) front-wheel drive 16 26 p compact 1999-07-14 1999-07-22 13:22:00 1999-03-02 01:18:00 NA NA weeks NA NA . NA
audi a4 2.8 1999 6 manual(m5) front-wheel drive 18 26 p compact 1999-11-02 1999-08-20 08:26:00 1999-04-03 22:19:00 14.172008 8.202642 weeks FALSE NA This is the worst car ever! NA

Data Summary Function

Below are a set of functions I wrote to using S4 (see https://www.cyclismo.org/tutorial/R/s4Classes.html for a gentle introduction to object oriented programming in R), culminating into a single function called data_summary. The basic structure uses an object of class dataSummaries and then, based on the class of x, the dataSummariesSetup method applied to the dataSummaries class, returns an object of class dataSummariesCharacter, dataSummariesNumeric, dataSummariesDate, or dataSummariesDifftime. Each of these four output classes inherits from the dataSummaries class; thus any method written for dataSummaries also applies to the four classes that inherit from it.

As input the data_summary function takes a variable to summarize (x), an optional variable or variables (as a character string) to summarize by (by), the data (data), and the units to use for difftime if x refers to a Date, POSIXlt, POSIXct, or difftime object in the data.

As output, the function returns an object of class dataSummaries. The function has a show method and a method called make_output that generates knitr friendly output. The summary table and plot can also be accessed individually through their accessor functions, data_summary_table, and data_summary_plot, respectively.

setOldClass(c("ggplot", "gg"))

dataSummaries <- setClass(
    "dataSummaries",
    
    slots = c(
        x = "character",
        by = "character",
        data = "data.frame",
        difftime_units = "character",
        xLab = "character",
        byLab = "character",
        table = "data.frame",
        plot = "ANY"
    ),
    
    prototype = list(
        x = character(0),
        by = character(0),
        data = data.frame(),
        difftime_units = character(0),
        xLab = character(0),
        byLab = character(0),
        table = data.frame(),
        plot = NULL
    ),
)

invisible(setValidity("dataSummaries", function(object) {
  if (!is.null(object@plot) && !inherits(object@plot, "ggplot")) {
    return("The 'plot' slot must be a ggplot object or NULL.")
  }
  TRUE
}))

dataSummariesCharacter <- setClass(
    "dataSummariesCharacter",
    
    slots = c(
        type = "character"
    ),
    
    prototype = list(
        type = character(0)
    ),
    
    contains = "dataSummaries"
)

dataSummariesNumeric <- setClass(
    "dataSummariesNumeric",
    
    slots = c(
        type = "character"
    ),
    
    prototype = list(
        type = character(0)
    ),
    
    contains = "dataSummaries"
)

dataSummariesDate <- setClass(
    "dataSummariesDate",
    
    slots = c(
        type = "character"
    ),
    
    prototype = list(
        type = character(0)
    ),
    
    contains = "dataSummaries"
)

dataSummariesDifftime <- setClass(
    "dataSummariesDifftime",
    
    slots = c(
        type = "character"
    ),
    
    prototype = list(
        type = character(0)
    ),
    
    contains = "dataSummaries"
)

invisible(setGeneric(name = "dataSummariesSetup", def = function(object) standardGeneric("dataSummariesSetup")))
setMethod(
    f = "dataSummariesSetup",
    signature = "dataSummaries", 
    definition = function(object) 
    {
        x = object@x
        by = object@by
        data = object@data
        
        xLab <- label(data[, x])
        colnames(data)[which(colnames(data) == x)] <- "var"
        
        if (length(by) == 0) {
            data$by <- factor(data$by <- "")
            label(data$by) <- ""
            byLab <- label(data$by)
        } else {
            data$by <- interaction(data[, by], sep = ", ")
            byLab <- paste(label(data[, by]), collapse = " by ")
            
            overall <- data
            overall$by <- "Overall"
            data <- rbind(data, overall)
        }
        
        data <- data[, c("var", "by")]
        
        if ("labelled" %in% class(data$var)) {
            class(data$var) <- class(data$var)[(-1)*which(class(data$var) == "labelled")]
        }
        
        object@xLab <- xLab
        object@byLab <- byLab
        object@data <- data
        
        if (any(c("character", "factor", "logical") %in% class(data$var))) { 
            return(dataSummariesCharacter(object, type = class(data$var)))
        } else if (any(c("numeric", "integer") %in% class(data$var))) {
            return(dataSummariesNumeric(object, type = class(data$var))) 
        } else if (any(c("Date", "POSIXlt", "POSIXct", "POSIXt") %in% class(data$var))) {
            if (length(object@difftime_units) == 0) stop("You need to specify the units for the difference in time.  See help(difftime) for additional information.")
            return(dataSummariesDate(object, type = class(data$var))) 
        } else if ("difftime" %in% class(data$var)) {
            if (length(object@difftime_units) == 0) stop("You need to specify the units for the difference in time.  See help(difftime) for additional information.")
            return(dataSummariesDifftime(object, type = class(data$var))) 
        } else {
            stop("x is an unsupported class")
        }
    }
)

invisible(setGeneric(name = "data_summary_switch", def = function(object) standardGeneric("data_summary_switch")))

setMethod(
    f = "data_summary_switch",
    signature = "dataSummariesCharacter", 
    definition = function(object) 
    {
        xLab <- object@xLab
        byLab <- object@byLab
        data <- object@data
        
        freqs <- table(data$var, data$by, useNA = "ifany", dnn = c(xLab, byLab))
        
        rownames(freqs)[which(is.na(rownames(freqs)))] <- "R NA Value"
        colnames(freqs)[which(is.na(colnames(freqs)))] <- "R NA Value" 
        
        props <- round(100*prop.table(freqs, 2), 2)
        
        res <- freqs
        for (i in 1:dim(freqs)[2]) {
            res[, i] <- paste(freqs[, i], " (", props[, i], "%)", sep = "")
        }
        res <- as.data.frame(res)
        colnames(res) <- c("var", "by", "freq")
        res <- dcast(res, var ~ by, value.var = "freq")
        colnames(res)[1] <- xLab
        if (byLab == "") colnames(res)[2] <- "n (%)"
        
        pData <- as.data.frame(props)
        colnames(pData) <- c("var", "by", "freq")
        
        levs <- as.character(pData$var)
        tmp <- nchar(levs)
        strCombRes <- list()
        for (k in 1:length(levs)) {
            strRes <- list()
            j = 0
            for (i in 1:ceiling(max(tmp)/30)) {
                strRes[[i]] <- substr(levs[k], j, 30*i)
                j = 30*i + 1
            }
            strCombRes[[k]] <- unlist(strRes)    
        }
        
        foo <- function(x) {
            if (!(length(which(x == "")) == 0)) x <- x[-1*which(x == "")]
            x <- paste(x, collapse = "\n")
            
            return(x)
        }
        
        levs <- unlist(lapply(strCombRes, foo))
        
        pData$names <- factor(rownames(pData), levels = rownames(pData), labels = levs)
        pData <- pData[, -1]
        
        colfunc <- colorRampPalette(c("#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"))
        colors <- colfunc(length(levels(pData$names)))
        
        p = ggplot(data = pData, aes(x = by, y = freq, fill = names)) +
            scale_fill_manual(values = colors) + 
            geom_bar(stat = "identity") + 
            xlab(paste(strwrap(xLab, width = 60), collapse = "\n")) +
            ylab("Percent") +
            theme(
                axis.line = element_line(colour = "black"),
                panel.border = element_rect(colour = "black", fill = NA, size = 1),
                axis.text = element_text(size = 12),
                axis.text.x = element_text(angle = 50, hjust = 1),
                axis.title = element_text(size = 12),
                legend.title = element_blank(),
                legend.position = "right",
                panel.grid = element_line(color = "lightgray"),
                panel.background = element_rect(fill = "white", colour = "white"))
        
        object@table <- res
        object@plot <- p
        
        return(object)
    }
)

setMethod(
    f = "data_summary_switch",
    signature = "dataSummariesNumeric", 
    definition = function(object) 
    {
        xLab <- object@xLab
        byLab <- object@byLab
        data <- object@data
        
        if (any(is.na(data$by))) {
            byLevs <- levels(data$by)
            data$by <- as.character(data$by)
            
            data$by[which(is.na(as.character(data$by)))] <- "R NA Value"
            data$by <- factor(data$by, levels = c(byLevs, "R NA Value"))
        }
        
        percMiss <- function(x) res <- round((length(which(is.na(x)))/length(x))*100, 2)
        
        res <- data %>%
            group_by(by) %>%
            summarize(
                label = xLab,
                n = length(na.omit(var)),
                miss = percMiss(var),
                mean = round(mean(var, na.rm = TRUE), 2),
                sd = round(sd(var, na.rm = TRUE), 2),
                median = round(median(var, na.rm = TRUE), 2),
                mad = round(mad(var, na.rm = TRUE), 2),
                q25 = round(quantile(var, probs = 0.25, na.rm = TRUE, type = 1), 2),
                q75 = round(quantile(var, probs = 0.75, na.rm = TRUE, type = 1), 2),
                IQR = round(IQR(var, na.rm = TRUE), 2),
                min = round(min(var, na.rm = TRUE), 2),
                max = round(max(var, na.rm = TRUE), 2)
            )
        
        res <- data.frame(res)
        
        colnames(res) <- c(byLab, "Label", "N", "P NA", "Mean", "S Dev", "Med", "MAD", "25th P", "75th P", "IQR", "Min", "Max")
        
        pData <- na.omit(data.frame(data[, c("var", "by")]))
        
        p = ggplot(data = pData, aes(x = by, y = var)) +
            geom_boxplot(position = position_dodge(1), fill = "#2c7bb6") +
            xlab(byLab) +
            ylab(paste(strwrap(xLab, width = 40), collapse = "\n")) +
            theme(
                axis.line = element_line(colour = "black"),
                panel.border = element_rect(colour = "black", fill = NA, size = 1),
                legend.position = "none",
                axis.text = element_text(size = 12),
                axis.text.x = element_text(angle = 50, hjust = 1),
                axis.title = element_text(size = 12), 
                panel.grid = element_line(color = "lightgray"),
                panel.background = element_rect(fill = "white", colour = "white"))
        
        object@table <- res
        object@plot <- p
        
        return(object)
    }
)

setMethod(
    f = "data_summary_switch",
    signature = "dataSummariesDate", 
    definition = function(object) 
    {
        xLab <- object@xLab
        byLab <- object@byLab
        data <- object@data
        difftime_units <- object@difftime_units
        
        if (any(is.na(data$by))) {
            byLevs <- levels(data$by)
            data$by <- as.character(data$by)
            
            data$by[which(is.na(as.character(data$by)))] <- "R NA Value"
            data$by <- factor(data$by, levels = c(byLevs, "R NA Value"))
        }
        
        percMiss <- function(x) round((length(which(is.na(x)))/length(x))*100, 2)
        
        sdDate <- function(x) {
            res <- difftime(x, mean(x, na.rm = TRUE), units = "secs")
            res <- as.numeric(as.character(res))
            res <- sd(res, na.rm = TRUE)
            res <- as.difftime(res, units = "secs")
            units(res) <- difftime_units
            
            return(res)
        }
        
        sdDate(data$var)
        
        madDate <- function(x) {
            res <- difftime(x, mean(x, na.rm = TRUE), units = "secs")
            res <- as.numeric(as.character(res))
            res <- mad(res, na.rm = TRUE)
            res <- as.difftime(res, units = "secs")
            units(res) <- difftime_units
            
            return(res)
        }
        
        dquantile <- function(x, probs){
            sx <- sort(x)
            pos <- round(probs*length(x))
            return(sx[pos])
        }
        
        q25Date <- function(x) dquantile(x, probs = 0.25)
        
        q75Date <- function(x) dquantile(x, probs = 0.75)
        
        IQRdate <- function(x) {
            res <- difftime(dquantile(x, probs = 0.75), dquantile(x, probs = 0.25), units = "secs")
            units(res) <- difftime_units
            return(res)
        }
        
        res <- data %>%
            group_by(by) %>%
            summarize(
                label = xLab,
                n = length(na.omit(var)),
                miss = percMiss(var),
                mean = mean(var, na.rm = TRUE),
                sd = round(sdDate(var), 2),
                median = median(var, na.rm = TRUE),
                mad = round(madDate(var), 2),
                q25 = q25Date(var),
                q75 = q75Date(var),
                IQR = IQRdate(var),
                min = min(var, na.rm = TRUE),
                max = max(var, na.rm = TRUE)
            )
        
        res <- data.frame(res)
        
        colnames(res) <- c(byLab, "Label", "N", "P NA", "Mean", "S Dev", "Med", "MAD", "25th P", "75th P", "IQR", "Min", "Max")
        
        pData <- na.omit(data.frame(data[, c("var", "by")]))
        
        if ("POSIXlt" %in% class(pData$var)) pData$var <- as.POSIXct(pData$var)
        
        p = ggplot(data = pData, aes(x = by, y = var)) +
            geom_boxplot(position = position_dodge(1), fill = "#2c7bb6") +
            xlab(byLab) +
            ylab(paste(strwrap(xLab, width = 40), collapse = "\n")) +
            theme(
                axis.line = element_line(colour = "black"),
                panel.border = element_rect(colour = "black", fill = NA, size = 1),
                legend.position = "none",
                axis.text = element_text(size = 12),
                axis.text.x = element_text(angle = 50, hjust = 1),
                axis.title = element_text(size = 12), 
                panel.grid = element_line(color = "lightgray"),
                panel.background = element_rect(fill = "white", colour = "white"))
        
        object@table <- res
        object@plot <- p
        
        return(object)
    }
)

setMethod(
    f = "data_summary_switch",
    signature = "dataSummariesDifftime", 
    definition = function(object) 
    {
        xLab <- object@xLab
        byLab <- object@byLab
        data <- object@data
        difftime_units <- object@difftime_units
        
        if (any(is.na(data$by))) {
            byLevs <- levels(data$by)
            data$by <- as.character(data$by)
            
            data$by[which(is.na(as.character(data$by)))] <- "R NA Value"
            data$by <- factor(data$by, levels = c(byLevs, "R NA Value"))
        }
        
        percMiss <- function(x) res <- round((length(which(is.na(x)))/length(x))*100, 2)
        
        units(data$var) <- "days"
        
        meanDate <- function(x) {
            res <- mean(x, na.rm = TRUE)
            units(res) <- difftime_units
            return(res)
        }
        
        medianDate <- function(x) {
            res <- median(x, na.rm = TRUE)
            units(res) <- difftime_units
            return(res)
        }
        
        sdDate <- function(x) {
            res <- as.difftime(sd(as.numeric(x), na.rm = TRUE), format = "%X", units = "days")
            units(res) <- difftime_units
            return(res)
        }
        
        madDate <- function(x) {
            res <- as.difftime(mad(as.numeric(x), na.rm = TRUE), format = "%X", units = "days")
            units(res) <- difftime_units
            return(res)
        }
        
        q25Date <- function(x) {
            res <- as.difftime(quantile(as.numeric(x), probs = 0.25, na.rm = TRUE, type = 1), units = "days")
            units(res) <- difftime_units
            return(res)
        }
        
        q75Date <- function(x) {
            res <- as.difftime(quantile(as.numeric(x), probs = 0.75, na.rm = TRUE, type = 1), units = "days")
            units(res) <- difftime_units
            return(res)
        }
        
        IQRdate <- function(x) {
            res <- as.difftime(IQR(as.numeric(x), na.rm = TRUE), format = "%X", units = "days")
            units(res) <- difftime_units
            return(res)
        }
        
        minDate <- function(x) {
            res <- as.difftime(min(as.numeric(x), na.rm = TRUE), format = "%X", units = "days")
            units(res) <- difftime_units
            return(res)
        }
        
        maxDate <- function(x) {
            res <- as.difftime(max(as.numeric(x), na.rm = TRUE), format = "%X", units = "days")
            units(res) <- difftime_units
            return(res)
        }  
        
        res <- data %>%
            group_by(by) %>%
            summarize(
                label = xLab,
                n = length(na.omit(var)),
                miss = percMiss(var),
                mean = round(meanDate(var), 2),
                sd = round(sdDate(var), 2),
                median = round(medianDate(var), 2),
                mad = round(madDate(var), 2),
                q25 = round(q25Date(var), 2),
                q75 = round(q75Date(var), 2),
                IQR = round(IQRdate(var), 2),
                min = round(minDate(var), 2),
                max = round(maxDate(var), 2)
            )
        
        res <- data.frame(res)
        
        colnames(res) <- c(byLab, "Label", "N", "P NA", "Mean", "S Dev", "Med", "MAD", "25th P", "75th P", "IQR", "Min", "Max")
        
        pData <- na.omit(data.frame(data[, c("var", "by")]))
        units(pData$var) <- difftime_units
        
        p = ggplot(data = pData, aes(x = by, y = var)) +
            geom_boxplot(position = position_dodge(1), fill = "#2c7bb6") +
            xlab(byLab) +
            ylab(paste(strwrap(xLab, width = 40), collapse = "\n")) +
            theme(
                axis.line = element_line(colour = "black"),
                panel.border = element_rect(colour = "black", fill = NA, size = 1),
                legend.position = "none",
                axis.text = element_text(size = 12),
                axis.text.x = element_text(angle = 50, hjust = 1),
                axis.title = element_text(size = 12), 
                panel.grid = element_line(color = "lightgray"),
                panel.background = element_rect(fill = "white", colour = "white"))
        
        object@table <- res
        object@plot <- p
        
        return(object)
    }
)

setMethod(
    f = "show",
    signature = "dataSummaries", 
    definition = function(object) 
    {
        print(object@table)
        print(object@plot)
    }
)

invisible(setGeneric(name = "make_kable_output", def = function(object) standardGeneric("make_kable_output")))
setMethod(
    f = "make_kable_output",
    signature = "dataSummaries", 
    definition = function(object) 
    {
        if (object@byLab == "") {
            print(
                kable(
                    object@table, caption = paste("Summary statistics of ", object@xLab, ".", sep = ""), booktabs = TRUE, table.attr = "data-quarto-disable-processing=true") %>% 
                    kable_styling(bootstrap_options = c("striped", "hover"), full_width = TRUE, font_size = 14))
        } else {
            print(
                kable(
                    object@table, caption = paste("Summary statistics of ", object@xLab, " by ", object@byLab, ".", sep = ""), booktabs = TRUE, table.attr = "data-quarto-disable-processing=true") %>% 
                    kable_styling(bootstrap_options = c("striped", "hover"), full_width = TRUE, font_size = 14))
        }
    }
)

invisible(setGeneric(name = "make_complete_output", def = function(object) standardGeneric("make_complete_output")))
setMethod(
    f = "make_complete_output",
    signature = "dataSummaries", 
    definition = function(object) 
    {
        if (object@byLab == "") {
            print(
                kable(
                    object@table, caption = paste("Summary statistics of ", object@xLab, ".", sep = ""), booktabs = TRUE, table.attr = "data-quarto-disable-processing=true") %>% 
                    kable_styling(bootstrap_options = c("striped", "hover"), full_width = TRUE, font_size = 14))
        } else {
            print(
                kable(
                    object@table, caption = paste("Summary statistics of ", object@xLab, " by ", object@byLab, ".", sep = ""), booktabs = TRUE, table.attr = "data-quarto-disable-processing=true") %>% 
                    kable_styling(bootstrap_options = c("striped", "hover"), full_width = TRUE, font_size = 14))
        }
        
        print(object@plot)
    }
)

invisible(setGeneric(name = "data_summary_table", def = function(object) standardGeneric("data_summary_table")))
setMethod(
    f = "data_summary_table",
    signature = "dataSummaries", 
    definition = function(object) 
    {
        object@table
    }
)

invisible(setGeneric(name = "data_summary_plot", def = function(object) standardGeneric("data_summary_plot")))
setMethod(
    f = "data_summary_plot",
    signature = "dataSummaries", 
    definition = function(object) 
    {
        object@plot
    }
)

data_summary <- function(x, by = character(0), data, difftime_units = character(0)) {
    object = dataSummaries(x = x, data = data, by = by, difftime_units = difftime_units)
    object = dataSummariesSetup(object)
    object = data_summary_switch(object)
}

Examples

show(cylSummaryExample)
  number of cylinders       n (%)
1                   4 81 (34.62%)
2                   5   4 (1.71%)
3                   6 79 (33.76%)
4                   8 70 (29.91%)

data_summary_table(cylSummaryExample)
  number of cylinders       n (%)
1                   4 81 (34.62%)
2                   5   4 (1.71%)
3                   6 79 (33.76%)
4                   8 70 (29.91%)
data_summary_plot(cylSummaryExample)

make_kable_output(cylSummaryExample)
Summary statistics of number of cylinders.
number of cylinders n (%)
4 81 (34.62%)
5 4 (1.71%)
6 79 (33.76%)
8 70 (29.91%)
make_complete_output(cylSummaryExample)
Summary statistics of number of cylinders.
number of cylinders n (%)
4 81 (34.62%)
5 4 (1.71%)
6 79 (33.76%)
8 70 (29.91%)

Stacked barplot of number of cylinders.
show(cylByYearSummaryExample)
  number of cylinders        1999        2008     Overall
1                   4 45 (38.46%) 36 (30.77%) 81 (34.62%)
2                   5      0 (0%)   4 (3.42%)   4 (1.71%)
3                   6 45 (38.46%) 34 (29.06%) 79 (33.76%)
4                   8 27 (23.08%) 43 (36.75%) 70 (29.91%)

data_summary_table(cylByYearSummaryExample)
  number of cylinders        1999        2008     Overall
1                   4 45 (38.46%) 36 (30.77%) 81 (34.62%)
2                   5      0 (0%)   4 (3.42%)   4 (1.71%)
3                   6 45 (38.46%) 34 (29.06%) 79 (33.76%)
4                   8 27 (23.08%) 43 (36.75%) 70 (29.91%)
data_summary_plot(cylByYearSummaryExample)

make_kable_output(cylByYearSummaryExample)
Summary statistics of number of cylinders by year of manufacture.
number of cylinders 1999 2008 Overall
4 45 (38.46%) 36 (30.77%) 81 (34.62%)
5 0 (0%) 4 (3.42%) 4 (1.71%)
6 45 (38.46%) 34 (29.06%) 79 (33.76%)
8 27 (23.08%) 43 (36.75%) 70 (29.91%)
make_complete_output(cylByYearSummaryExample)
Summary statistics of number of cylinders by year of manufacture.
number of cylinders 1999 2008 Overall
4 45 (38.46%) 36 (30.77%) 81 (34.62%)
5 0 (0%) 4 (3.42%) 4 (1.71%)
6 45 (38.46%) 34 (29.06%) 79 (33.76%)
8 27 (23.08%) 43 (36.75%) 70 (29.91%)

Stacked barplot of number of cylinders by year of manufacture.
show(cylByYearByPartySummaryExample)
  number of cylinders 1999, republican 2008, republican 1999, democrat
1                   4      14 (45.16%)          9 (36%)       12 (40%)
2                   5           0 (0%)           1 (4%)         0 (0%)
3                   6      12 (38.71%)          5 (20%)     7 (23.33%)
4                   8       5 (16.13%)         10 (40%)    11 (36.67%)
  2008, democrat 1999, independent 2008, independent     Overall  R NA Value
1     8 (25.81%)        9 (32.14%)       12 (35.29%) 81 (34.62%) 17 (30.91%)
2      2 (6.45%)            0 (0%)            0 (0%)   4 (1.71%)   1 (1.82%)
3     6 (19.35%)       13 (46.43%)       12 (35.29%) 79 (33.76%) 24 (43.64%)
4    15 (48.39%)        6 (21.43%)       10 (29.41%) 70 (29.91%) 13 (23.64%)

data_summary_table(cylByYearByPartySummaryExample)
  number of cylinders 1999, republican 2008, republican 1999, democrat
1                   4      14 (45.16%)          9 (36%)       12 (40%)
2                   5           0 (0%)           1 (4%)         0 (0%)
3                   6      12 (38.71%)          5 (20%)     7 (23.33%)
4                   8       5 (16.13%)         10 (40%)    11 (36.67%)
  2008, democrat 1999, independent 2008, independent     Overall  R NA Value
1     8 (25.81%)        9 (32.14%)       12 (35.29%) 81 (34.62%) 17 (30.91%)
2      2 (6.45%)            0 (0%)            0 (0%)   4 (1.71%)   1 (1.82%)
3     6 (19.35%)       13 (46.43%)       12 (35.29%) 79 (33.76%) 24 (43.64%)
4    15 (48.39%)        6 (21.43%)       10 (29.41%) 70 (29.91%) 13 (23.64%)
data_summary_plot(cylByYearByPartySummaryExample)

make_kable_output(cylByYearByPartySummaryExample)
Summary statistics of number of cylinders by year of manufacture by some random political parties.
number of cylinders 1999, republican 2008, republican 1999, democrat 2008, democrat 1999, independent 2008, independent Overall R NA Value
4 14 (45.16%) 9 (36%) 12 (40%) 8 (25.81%) 9 (32.14%) 12 (35.29%) 81 (34.62%) 17 (30.91%)
5 0 (0%) 1 (4%) 0 (0%) 2 (6.45%) 0 (0%) 0 (0%) 4 (1.71%) 1 (1.82%)
6 12 (38.71%) 5 (20%) 7 (23.33%) 6 (19.35%) 13 (46.43%) 12 (35.29%) 79 (33.76%) 24 (43.64%)
8 5 (16.13%) 10 (40%) 11 (36.67%) 15 (48.39%) 6 (21.43%) 10 (29.41%) 70 (29.91%) 13 (23.64%)
make_complete_output(cylByYearByPartySummaryExample)
Summary statistics of number of cylinders by year of manufacture by some random political parties.
number of cylinders 1999, republican 2008, republican 1999, democrat 2008, democrat 1999, independent 2008, independent Overall R NA Value
4 14 (45.16%) 9 (36%) 12 (40%) 8 (25.81%) 9 (32.14%) 12 (35.29%) 81 (34.62%) 17 (30.91%)
5 0 (0%) 1 (4%) 0 (0%) 2 (6.45%) 0 (0%) 0 (0%) 4 (1.71%) 1 (1.82%)
6 12 (38.71%) 5 (20%) 7 (23.33%) 6 (19.35%) 13 (46.43%) 12 (35.29%) 79 (33.76%) 24 (43.64%)
8 5 (16.13%) 10 (40%) 11 (36.67%) 15 (48.39%) 6 (21.43%) 10 (29.41%) 70 (29.91%) 13 (23.64%)

Stacked barplot of number of cylinders by year of manufacture by some random political parties.
show(ctySummaryExample)
                   Label   N P NA  Mean S Dev Med  MAD 25th P 75th P IQR Min
1  city miles per gallon 234    0 16.86  4.26  17 4.45     14     19   5   9
  Max
1  35

data_summary_table(ctySummaryExample)
                   Label   N P NA  Mean S Dev Med  MAD 25th P 75th P IQR Min
1  city miles per gallon 234    0 16.86  4.26  17 4.45     14     19   5   9
  Max
1  35
data_summary_plot(ctySummaryExample)

make_kable_output(ctySummaryExample)
Summary statistics of city miles per gallon.
Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
city miles per gallon 234 0 16.86 4.26 17 4.45 14 19 5 9 35
make_complete_output(ctySummaryExample)
Summary statistics of city miles per gallon.
Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
city miles per gallon 234 0 16.86 4.26 17 4.45 14 19 5 9 35

Stacked barplot of city miles per gallon.
show(ctyByCylSummaryExample)
  number of cylinders                 Label   N P NA  Mean S Dev  Med  MAD
1                   4 city miles per gallon  81    0 21.01  3.50 21.0 2.97
2                   5 city miles per gallon   4    0 20.50  0.58 20.5 0.74
3                   6 city miles per gallon  79    0 16.22  1.77 16.0 1.48
4                   8 city miles per gallon  70    0 12.57  1.81 13.0 2.22
5             Overall city miles per gallon 234    0 16.86  4.26 17.0 4.45
  25th P 75th P IQR Min Max
1     19     22   3  15  35
2     20     21   1  20  21
3     15     18   3  11  19
4     11     14   3   9  16
5     14     19   5   9  35

data_summary_table(ctyByCylSummaryExample)
  number of cylinders                 Label   N P NA  Mean S Dev  Med  MAD
1                   4 city miles per gallon  81    0 21.01  3.50 21.0 2.97
2                   5 city miles per gallon   4    0 20.50  0.58 20.5 0.74
3                   6 city miles per gallon  79    0 16.22  1.77 16.0 1.48
4                   8 city miles per gallon  70    0 12.57  1.81 13.0 2.22
5             Overall city miles per gallon 234    0 16.86  4.26 17.0 4.45
  25th P 75th P IQR Min Max
1     19     22   3  15  35
2     20     21   1  20  21
3     15     18   3  11  19
4     11     14   3   9  16
5     14     19   5   9  35
data_summary_plot(ctyByCylSummaryExample)

make_kable_output(ctyByCylSummaryExample)
Summary statistics of city miles per gallon by number of cylinders.
number of cylinders Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4 city miles per gallon 81 0 21.01 3.50 21.0 2.97 19 22 3 15 35
5 city miles per gallon 4 0 20.50 0.58 20.5 0.74 20 21 1 20 21
6 city miles per gallon 79 0 16.22 1.77 16.0 1.48 15 18 3 11 19
8 city miles per gallon 70 0 12.57 1.81 13.0 2.22 11 14 3 9 16
Overall city miles per gallon 234 0 16.86 4.26 17.0 4.45 14 19 5 9 35
make_complete_output(ctyByCylSummaryExample)
Summary statistics of city miles per gallon by number of cylinders.
number of cylinders Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4 city miles per gallon 81 0 21.01 3.50 21.0 2.97 19 22 3 15 35
5 city miles per gallon 4 0 20.50 0.58 20.5 0.74 20 21 1 20 21
6 city miles per gallon 79 0 16.22 1.77 16.0 1.48 15 18 3 11 19
8 city miles per gallon 70 0 12.57 1.81 13.0 2.22 11 14 3 9 16
Overall city miles per gallon 234 0 16.86 4.26 17.0 4.45 14 19 5 9 35

Stacked barplot of city miles per gallon by number of cylinders.
show(ctyByCylByYearSummaryExample)
  number of cylinders by year of manufacture                 Label   N P NA
1                                    4, 1999 city miles per gallon  45    0
2                                    6, 1999 city miles per gallon  45    0
3                                    8, 1999 city miles per gallon  27    0
4                                    4, 2008 city miles per gallon  36    0
5                                    5, 2008 city miles per gallon   4    0
6                                    6, 2008 city miles per gallon  34    0
7                                    8, 2008 city miles per gallon  43    0
8                                    Overall city miles per gallon 234    0
   Mean S Dev  Med  MAD 25th P 75th P IQR Min Max
1 20.84  4.24 19.0 2.97     18     21 3.0  15  35
2 16.07  1.67 16.0 2.97     15     18 3.0  13  19
3 12.22  1.65 11.0 0.00     11     13 2.0  11  16
4 21.22  2.29 21.0 1.48     20     22 2.0  17  28
5 20.50  0.58 20.5 0.74     20     21 1.0  20  21
6 16.41  1.91 17.0 1.48     15     18 2.5  11  19
7 12.79  1.88 13.0 1.48     12     14 2.0   9  16
8 16.86  4.26 17.0 4.45     14     19 5.0   9  35

data_summary_table(ctyByCylByYearSummaryExample)
  number of cylinders by year of manufacture                 Label   N P NA
1                                    4, 1999 city miles per gallon  45    0
2                                    6, 1999 city miles per gallon  45    0
3                                    8, 1999 city miles per gallon  27    0
4                                    4, 2008 city miles per gallon  36    0
5                                    5, 2008 city miles per gallon   4    0
6                                    6, 2008 city miles per gallon  34    0
7                                    8, 2008 city miles per gallon  43    0
8                                    Overall city miles per gallon 234    0
   Mean S Dev  Med  MAD 25th P 75th P IQR Min Max
1 20.84  4.24 19.0 2.97     18     21 3.0  15  35
2 16.07  1.67 16.0 2.97     15     18 3.0  13  19
3 12.22  1.65 11.0 0.00     11     13 2.0  11  16
4 21.22  2.29 21.0 1.48     20     22 2.0  17  28
5 20.50  0.58 20.5 0.74     20     21 1.0  20  21
6 16.41  1.91 17.0 1.48     15     18 2.5  11  19
7 12.79  1.88 13.0 1.48     12     14 2.0   9  16
8 16.86  4.26 17.0 4.45     14     19 5.0   9  35
data_summary_plot(ctyByCylByYearSummaryExample)

make_kable_output(ctyByCylByYearSummaryExample)
Summary statistics of city miles per gallon by number of cylinders by year of manufacture.
number of cylinders by year of manufacture Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4, 1999 city miles per gallon 45 0 20.84 4.24 19.0 2.97 18 21 3.0 15 35
6, 1999 city miles per gallon 45 0 16.07 1.67 16.0 2.97 15 18 3.0 13 19
8, 1999 city miles per gallon 27 0 12.22 1.65 11.0 0.00 11 13 2.0 11 16
4, 2008 city miles per gallon 36 0 21.22 2.29 21.0 1.48 20 22 2.0 17 28
5, 2008 city miles per gallon 4 0 20.50 0.58 20.5 0.74 20 21 1.0 20 21
6, 2008 city miles per gallon 34 0 16.41 1.91 17.0 1.48 15 18 2.5 11 19
8, 2008 city miles per gallon 43 0 12.79 1.88 13.0 1.48 12 14 2.0 9 16
Overall city miles per gallon 234 0 16.86 4.26 17.0 4.45 14 19 5.0 9 35
make_complete_output(ctyByCylByYearSummaryExample)
Summary statistics of city miles per gallon by number of cylinders by year of manufacture.
number of cylinders by year of manufacture Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4, 1999 city miles per gallon 45 0 20.84 4.24 19.0 2.97 18 21 3.0 15 35
6, 1999 city miles per gallon 45 0 16.07 1.67 16.0 2.97 15 18 3.0 13 19
8, 1999 city miles per gallon 27 0 12.22 1.65 11.0 0.00 11 13 2.0 11 16
4, 2008 city miles per gallon 36 0 21.22 2.29 21.0 1.48 20 22 2.0 17 28
5, 2008 city miles per gallon 4 0 20.50 0.58 20.5 0.74 20 21 1.0 20 21
6, 2008 city miles per gallon 34 0 16.41 1.91 17.0 1.48 15 18 2.5 11 19
8, 2008 city miles per gallon 43 0 12.79 1.88 13.0 1.48 12 14 2.0 9 16
Overall city miles per gallon 234 0 16.86 4.26 17.0 4.45 14 19 5.0 9 35

Stacked barplot of city miles per gallon by number of cylinders by year of manufacture.
show(dpSummaryExample)
                           Label   N P NA       Mean        S Dev        Med
1  date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24
          MAD     25th P     75th P            IQR        Min        Max
1 74.98 weeks 1999-07-14 2008-09-01 476.7143 weeks 1999-01-04 2008-12-23

data_summary_table(dpSummaryExample)
                           Label   N P NA       Mean        S Dev        Med
1  date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24
          MAD     25th P     75th P            IQR        Min        Max
1 74.98 weeks 1999-07-14 2008-09-01 476.7143 weeks 1999-01-04 2008-12-23
data_summary_plot(dpSummaryExample)

make_kable_output(dpSummaryExample)
Summary statistics of date of purchase (Date class).
Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.7143 weeks 1999-01-04 2008-12-23
make_complete_output(dpSummaryExample)
Summary statistics of date of purchase (Date class).
Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.7143 weeks 1999-01-04 2008-12-23

Stacked barplot of date of purchase (Date class).
show(dpByCylSummaryExample)
  number of cylinders                         Label   N  P NA       Mean
1                   4 date of purchase (Date class)  73  8.75 2003-03-03
2                   5 date of purchase (Date class)   3 25.00 2008-09-25
3                   6 date of purchase (Date class)  71 10.13 2003-06-14
4                   8 date of purchase (Date class)  66  5.71 2005-03-13
5             Overall date of purchase (Date class) 213  8.58 2003-12-21
         S Dev        Med         MAD     25th P     75th P             IQR
1 234.04 weeks 1999-10-11 49.35 weeks 1999-06-03 2008-07-28 477.57143 weeks
2  16.08 weeks 2008-11-13  6.78 weeks 2008-05-20 2008-12-15  29.85714 weeks
3 235.29 weeks 1999-11-02 50.20 weeks 1999-07-14 2008-08-02 472.42857 weeks
4 229.06 weeks 2008-02-10 52.42 weeks 1999-10-04 2008-09-08 466.00000 weeks
5 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.71429 weeks
         Min        Max
1 1999-01-14 2008-12-23
2 2008-05-20 2008-12-15
3 1999-01-05 2008-12-09
4 1999-01-04 2008-12-14
5 1999-01-04 2008-12-23

data_summary_table(dpByCylSummaryExample)
  number of cylinders                         Label   N  P NA       Mean
1                   4 date of purchase (Date class)  73  8.75 2003-03-03
2                   5 date of purchase (Date class)   3 25.00 2008-09-25
3                   6 date of purchase (Date class)  71 10.13 2003-06-14
4                   8 date of purchase (Date class)  66  5.71 2005-03-13
5             Overall date of purchase (Date class) 213  8.58 2003-12-21
         S Dev        Med         MAD     25th P     75th P             IQR
1 234.04 weeks 1999-10-11 49.35 weeks 1999-06-03 2008-07-28 477.57143 weeks
2  16.08 weeks 2008-11-13  6.78 weeks 2008-05-20 2008-12-15  29.85714 weeks
3 235.29 weeks 1999-11-02 50.20 weeks 1999-07-14 2008-08-02 472.42857 weeks
4 229.06 weeks 2008-02-10 52.42 weeks 1999-10-04 2008-09-08 466.00000 weeks
5 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.71429 weeks
         Min        Max
1 1999-01-14 2008-12-23
2 2008-05-20 2008-12-15
3 1999-01-05 2008-12-09
4 1999-01-04 2008-12-14
5 1999-01-04 2008-12-23
data_summary_plot(dpByCylSummaryExample)

make_kable_output(dpByCylSummaryExample)
Summary statistics of date of purchase (Date class) by number of cylinders.
number of cylinders Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4 date of purchase (Date class) 73 8.75 2003-03-03 234.04 weeks 1999-10-11 49.35 weeks 1999-06-03 2008-07-28 477.57143 weeks 1999-01-14 2008-12-23
5 date of purchase (Date class) 3 25.00 2008-09-25 16.08 weeks 2008-11-13 6.78 weeks 2008-05-20 2008-12-15 29.85714 weeks 2008-05-20 2008-12-15
6 date of purchase (Date class) 71 10.13 2003-06-14 235.29 weeks 1999-11-02 50.20 weeks 1999-07-14 2008-08-02 472.42857 weeks 1999-01-05 2008-12-09
8 date of purchase (Date class) 66 5.71 2005-03-13 229.06 weeks 2008-02-10 52.42 weeks 1999-10-04 2008-09-08 466.00000 weeks 1999-01-04 2008-12-14
Overall date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.71429 weeks 1999-01-04 2008-12-23
make_complete_output(dpByCylSummaryExample)
Summary statistics of date of purchase (Date class) by number of cylinders.
number of cylinders Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4 date of purchase (Date class) 73 8.75 2003-03-03 234.04 weeks 1999-10-11 49.35 weeks 1999-06-03 2008-07-28 477.57143 weeks 1999-01-14 2008-12-23
5 date of purchase (Date class) 3 25.00 2008-09-25 16.08 weeks 2008-11-13 6.78 weeks 2008-05-20 2008-12-15 29.85714 weeks 2008-05-20 2008-12-15
6 date of purchase (Date class) 71 10.13 2003-06-14 235.29 weeks 1999-11-02 50.20 weeks 1999-07-14 2008-08-02 472.42857 weeks 1999-01-05 2008-12-09
8 date of purchase (Date class) 66 5.71 2005-03-13 229.06 weeks 2008-02-10 52.42 weeks 1999-10-04 2008-09-08 466.00000 weeks 1999-01-04 2008-12-14
Overall date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.71429 weeks 1999-01-04 2008-12-23

Stacked barplot of date of purchase (Date class) by number of cylinders.
show(dpByCylByCommentsSummaryExample)
         number of cylinders by some random comments
1                                               4, .
2                                               6, .
3                                               8, .
4  4, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
5  6, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
6  8, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
7                               4, Does it also fly?
8                               6, Does it also fly?
9                               8, Does it also fly?
10                         4, Does it come in green?
11                         6, Does it come in green?
12                         8, Does it come in green?
13                               4, I like this car!
14                               6, I like this car!
15                               8, I like this car!
16                                           4, Meh.
17                                           6, Meh.
18                                           8, Meh.
19                                        4, Missing
20                                        6, Missing
21                                        8, Missing
22                    4, This is the worst car ever!
23                    6, This is the worst car ever!
24                    8, This is the worst car ever!
25                    4, want cheese flavoured cars.
26                    6, want cheese flavoured cars.
27                    8, want cheese flavoured cars.
28                                           Overall
29                                        R NA Value
                           Label   N  P NA       Mean        S Dev        Med
1  date of purchase (Date class)   5  0.00 2003-01-27 252.39 weeks 1999-10-26
2  date of purchase (Date class)   9  0.00 2004-08-21 241.15 weeks 2008-04-02
3  date of purchase (Date class)  10  9.09 2004-11-28 246.03 weeks 2008-02-07
4  date of purchase (Date class)   9  0.00 2002-08-10 241.71 weeks 1999-09-12
5  date of purchase (Date class)   7 12.50 2004-08-16 254.96 weeks 2008-05-13
6  date of purchase (Date class)   4  0.00 2004-01-07 274.68 weeks 2004-02-23
7  date of purchase (Date class)   5  0.00 2002-12-14 265.47 weeks 1999-08-06
8  date of purchase (Date class)   4 42.86 2001-09-28 225.84 weeks 1999-08-23
9  date of purchase (Date class)   4  0.00 2004-03-25 272.68 weeks 2004-04-06
10 date of purchase (Date class)  15  0.00 2003-07-23 243.88 weeks 1999-08-26
11 date of purchase (Date class)   3  0.00 2002-06-23 268.42 weeks 1999-09-09
12 date of purchase (Date class)   5  0.00 2006-07-09 217.62 weeks 2008-02-09
13 date of purchase (Date class)   8 11.11 2005-04-06 247.72 weeks 2008-07-29
14 date of purchase (Date class)   7 22.22 2002-01-30 232.78 weeks 1999-08-23
15 date of purchase (Date class)   4  0.00 2001-11-20 246.39 weeks 1999-09-27
16 date of purchase (Date class)   6  0.00 1999-05-01   9.86 weeks 1999-04-25
17 date of purchase (Date class)   6  0.00 2005-06-05 248.14 weeks 2008-04-27
18 date of purchase (Date class)   5 16.67 2008-04-14   9.80 weeks 2008-04-15
19 date of purchase (Date class)   3 50.00 2002-08-26 280.92 weeks 1999-10-09
20 date of purchase (Date class)   5  0.00 2004-12-23 255.73 weeks 2008-05-24
21 date of purchase (Date class)  14  0.00 2005-11-13 226.66 weeks 2008-04-02
22 date of purchase (Date class)   7  0.00 2003-05-28 247.48 weeks 1999-11-24
23 date of purchase (Date class)   9 10.00 2002-08-03 237.70 weeks 1999-10-18
24 date of purchase (Date class)   5  0.00 2006-09-25 213.60 weeks 2008-07-04
25 date of purchase (Date class)  10  9.09 2003-02-13 238.91 weeks 1999-12-10
26 date of purchase (Date class)  13  0.00 2002-04-09 231.98 weeks 1999-08-31
27 date of purchase (Date class)   8 11.11 2005-01-02 240.53 weeks 2008-02-06
28 date of purchase (Date class) 213  8.58 2003-12-21 236.59 weeks 1999-12-24
29 date of purchase (Date class)  20 16.67 2003-12-06 236.95 weeks 2003-12-24
            MAD     25th P     75th P              IQR        Min        Max
1   54.64 weeks 1999-02-10 2008-02-08 469.285714 weeks 1999-02-10 2008-08-12
2   44.27 weeks 1999-08-28 2008-06-18 459.571429 weeks 1999-07-14 2008-10-28
3   61.53 weeks 1999-10-05 2008-09-06 465.571429 weeks 1999-01-13 2008-11-27
4   38.34 weeks 1999-03-15 2008-05-25 479.857143 weeks 1999-03-08 2008-12-23
5   31.13 weeks 1999-06-07 2008-08-02 477.714286 weeks 1999-03-19 2008-10-07
6  342.16 weeks 1999-02-03 2008-06-12 488.142857 weeks 1999-02-03 2008-09-09
7   43.21 weeks 1999-01-14 2008-02-14 474.000000 weeks 1999-01-14 2008-11-26
8   12.71 weeks 1999-07-03       <NA>         NA weeks 1999-06-15 2008-03-25
9  347.46 weeks 1999-07-16 2008-08-25 475.428571 weeks 1999-07-16 2008-11-10
10  47.02 weeks 1999-03-24 2008-02-26 465.857143 weeks 1999-01-16 2008-10-13
11  27.75 weeks 1999-05-01 1999-09-09  18.714286 weeks 1999-05-01 2008-05-31
12  24.15 weeks 1999-02-01 2008-06-02 487.000000 weeks 1999-02-01 2008-12-08
13  20.33 weeks 1999-06-23 2008-09-23 482.857143 weeks 1999-06-08 2008-12-12
14  25.84 weeks 1999-04-23 2008-09-05 489.000000 weeks 1999-03-13 2008-09-05
15  30.61 weeks 1999-02-12 1999-11-28  41.285714 weeks 1999-02-12 2008-12-14
16   8.47 weeks 1999-03-26 1999-05-16   7.285714 weeks 1999-01-25 1999-08-11
17  26.58 weeks 1999-07-31 2008-05-08 457.714286 weeks 1999-01-05 2008-09-26
18  11.44 weeks 2008-02-21 2008-05-27  13.714286 weeks 2008-01-27 2008-07-13
19  34.74 weeks 1999-10-09       <NA>         NA weeks 1999-04-28 2008-11-11
20  21.18 weeks 1999-07-30 2008-08-09 471.142857 weeks 1999-07-30 2008-09-01
21  38.55 weeks 1999-10-04 2008-09-08 466.000000 weeks 1999-01-04 2008-11-15
22  50.62 weeks 1999-06-03 2008-02-10 453.428571 weeks 1999-03-30 2008-09-29
23  38.34 weeks 1999-04-20 2008-09-13 490.571429 weeks 1999-03-22 2008-10-26
24  16.10 weeks 1999-06-02 2008-09-18 485.142857 weeks 1999-06-02 2008-09-19
25  57.50 weeks 1999-06-09 2008-05-15 466.142857 weeks 1999-02-17 2008-10-31
26  36.85 weeks 1999-03-10 2008-06-24 484.857143 weeks 1999-01-26 2008-12-09
27  44.16 weeks 1999-05-21 2008-07-18 478.000000 weeks 1999-04-01 2008-10-18
28  74.98 weeks 1999-07-14 2008-09-01 476.714286 weeks 1999-01-04 2008-12-23
29 337.72 weeks 1999-08-14 2008-06-25 462.571429 weeks 1999-01-07 2008-12-03

data_summary_table(dpByCylByCommentsSummaryExample)
         number of cylinders by some random comments
1                                               4, .
2                                               6, .
3                                               8, .
4  4, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
5  6, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
6  8, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
7                               4, Does it also fly?
8                               6, Does it also fly?
9                               8, Does it also fly?
10                         4, Does it come in green?
11                         6, Does it come in green?
12                         8, Does it come in green?
13                               4, I like this car!
14                               6, I like this car!
15                               8, I like this car!
16                                           4, Meh.
17                                           6, Meh.
18                                           8, Meh.
19                                        4, Missing
20                                        6, Missing
21                                        8, Missing
22                    4, This is the worst car ever!
23                    6, This is the worst car ever!
24                    8, This is the worst car ever!
25                    4, want cheese flavoured cars.
26                    6, want cheese flavoured cars.
27                    8, want cheese flavoured cars.
28                                           Overall
29                                        R NA Value
                           Label   N  P NA       Mean        S Dev        Med
1  date of purchase (Date class)   5  0.00 2003-01-27 252.39 weeks 1999-10-26
2  date of purchase (Date class)   9  0.00 2004-08-21 241.15 weeks 2008-04-02
3  date of purchase (Date class)  10  9.09 2004-11-28 246.03 weeks 2008-02-07
4  date of purchase (Date class)   9  0.00 2002-08-10 241.71 weeks 1999-09-12
5  date of purchase (Date class)   7 12.50 2004-08-16 254.96 weeks 2008-05-13
6  date of purchase (Date class)   4  0.00 2004-01-07 274.68 weeks 2004-02-23
7  date of purchase (Date class)   5  0.00 2002-12-14 265.47 weeks 1999-08-06
8  date of purchase (Date class)   4 42.86 2001-09-28 225.84 weeks 1999-08-23
9  date of purchase (Date class)   4  0.00 2004-03-25 272.68 weeks 2004-04-06
10 date of purchase (Date class)  15  0.00 2003-07-23 243.88 weeks 1999-08-26
11 date of purchase (Date class)   3  0.00 2002-06-23 268.42 weeks 1999-09-09
12 date of purchase (Date class)   5  0.00 2006-07-09 217.62 weeks 2008-02-09
13 date of purchase (Date class)   8 11.11 2005-04-06 247.72 weeks 2008-07-29
14 date of purchase (Date class)   7 22.22 2002-01-30 232.78 weeks 1999-08-23
15 date of purchase (Date class)   4  0.00 2001-11-20 246.39 weeks 1999-09-27
16 date of purchase (Date class)   6  0.00 1999-05-01   9.86 weeks 1999-04-25
17 date of purchase (Date class)   6  0.00 2005-06-05 248.14 weeks 2008-04-27
18 date of purchase (Date class)   5 16.67 2008-04-14   9.80 weeks 2008-04-15
19 date of purchase (Date class)   3 50.00 2002-08-26 280.92 weeks 1999-10-09
20 date of purchase (Date class)   5  0.00 2004-12-23 255.73 weeks 2008-05-24
21 date of purchase (Date class)  14  0.00 2005-11-13 226.66 weeks 2008-04-02
22 date of purchase (Date class)   7  0.00 2003-05-28 247.48 weeks 1999-11-24
23 date of purchase (Date class)   9 10.00 2002-08-03 237.70 weeks 1999-10-18
24 date of purchase (Date class)   5  0.00 2006-09-25 213.60 weeks 2008-07-04
25 date of purchase (Date class)  10  9.09 2003-02-13 238.91 weeks 1999-12-10
26 date of purchase (Date class)  13  0.00 2002-04-09 231.98 weeks 1999-08-31
27 date of purchase (Date class)   8 11.11 2005-01-02 240.53 weeks 2008-02-06
28 date of purchase (Date class) 213  8.58 2003-12-21 236.59 weeks 1999-12-24
29 date of purchase (Date class)  20 16.67 2003-12-06 236.95 weeks 2003-12-24
            MAD     25th P     75th P              IQR        Min        Max
1   54.64 weeks 1999-02-10 2008-02-08 469.285714 weeks 1999-02-10 2008-08-12
2   44.27 weeks 1999-08-28 2008-06-18 459.571429 weeks 1999-07-14 2008-10-28
3   61.53 weeks 1999-10-05 2008-09-06 465.571429 weeks 1999-01-13 2008-11-27
4   38.34 weeks 1999-03-15 2008-05-25 479.857143 weeks 1999-03-08 2008-12-23
5   31.13 weeks 1999-06-07 2008-08-02 477.714286 weeks 1999-03-19 2008-10-07
6  342.16 weeks 1999-02-03 2008-06-12 488.142857 weeks 1999-02-03 2008-09-09
7   43.21 weeks 1999-01-14 2008-02-14 474.000000 weeks 1999-01-14 2008-11-26
8   12.71 weeks 1999-07-03       <NA>         NA weeks 1999-06-15 2008-03-25
9  347.46 weeks 1999-07-16 2008-08-25 475.428571 weeks 1999-07-16 2008-11-10
10  47.02 weeks 1999-03-24 2008-02-26 465.857143 weeks 1999-01-16 2008-10-13
11  27.75 weeks 1999-05-01 1999-09-09  18.714286 weeks 1999-05-01 2008-05-31
12  24.15 weeks 1999-02-01 2008-06-02 487.000000 weeks 1999-02-01 2008-12-08
13  20.33 weeks 1999-06-23 2008-09-23 482.857143 weeks 1999-06-08 2008-12-12
14  25.84 weeks 1999-04-23 2008-09-05 489.000000 weeks 1999-03-13 2008-09-05
15  30.61 weeks 1999-02-12 1999-11-28  41.285714 weeks 1999-02-12 2008-12-14
16   8.47 weeks 1999-03-26 1999-05-16   7.285714 weeks 1999-01-25 1999-08-11
17  26.58 weeks 1999-07-31 2008-05-08 457.714286 weeks 1999-01-05 2008-09-26
18  11.44 weeks 2008-02-21 2008-05-27  13.714286 weeks 2008-01-27 2008-07-13
19  34.74 weeks 1999-10-09       <NA>         NA weeks 1999-04-28 2008-11-11
20  21.18 weeks 1999-07-30 2008-08-09 471.142857 weeks 1999-07-30 2008-09-01
21  38.55 weeks 1999-10-04 2008-09-08 466.000000 weeks 1999-01-04 2008-11-15
22  50.62 weeks 1999-06-03 2008-02-10 453.428571 weeks 1999-03-30 2008-09-29
23  38.34 weeks 1999-04-20 2008-09-13 490.571429 weeks 1999-03-22 2008-10-26
24  16.10 weeks 1999-06-02 2008-09-18 485.142857 weeks 1999-06-02 2008-09-19
25  57.50 weeks 1999-06-09 2008-05-15 466.142857 weeks 1999-02-17 2008-10-31
26  36.85 weeks 1999-03-10 2008-06-24 484.857143 weeks 1999-01-26 2008-12-09
27  44.16 weeks 1999-05-21 2008-07-18 478.000000 weeks 1999-04-01 2008-10-18
28  74.98 weeks 1999-07-14 2008-09-01 476.714286 weeks 1999-01-04 2008-12-23
29 337.72 weeks 1999-08-14 2008-06-25 462.571429 weeks 1999-01-07 2008-12-03
data_summary_plot(dpByCylByCommentsSummaryExample)

make_kable_output(dpByCylByCommentsSummaryExample)
Summary statistics of date of purchase (Date class) by number of cylinders by some random comments.
number of cylinders by some random comments Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4, . date of purchase (Date class) 5 0.00 2003-01-27 252.39 weeks 1999-10-26 54.64 weeks 1999-02-10 2008-02-08 469.285714 weeks 1999-02-10 2008-08-12
6, . date of purchase (Date class) 9 0.00 2004-08-21 241.15 weeks 2008-04-02 44.27 weeks 1999-08-28 2008-06-18 459.571429 weeks 1999-07-14 2008-10-28
8, . date of purchase (Date class) 10 9.09 2004-11-28 246.03 weeks 2008-02-07 61.53 weeks 1999-10-05 2008-09-06 465.571429 weeks 1999-01-13 2008-11-27
4, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah date of purchase (Date class) 9 0.00 2002-08-10 241.71 weeks 1999-09-12 38.34 weeks 1999-03-15 2008-05-25 479.857143 weeks 1999-03-08 2008-12-23
6, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah date of purchase (Date class) 7 12.50 2004-08-16 254.96 weeks 2008-05-13 31.13 weeks 1999-06-07 2008-08-02 477.714286 weeks 1999-03-19 2008-10-07
8, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah date of purchase (Date class) 4 0.00 2004-01-07 274.68 weeks 2004-02-23 342.16 weeks 1999-02-03 2008-06-12 488.142857 weeks 1999-02-03 2008-09-09
4, Does it also fly? date of purchase (Date class) 5 0.00 2002-12-14 265.47 weeks 1999-08-06 43.21 weeks 1999-01-14 2008-02-14 474.000000 weeks 1999-01-14 2008-11-26
6, Does it also fly? date of purchase (Date class) 4 42.86 2001-09-28 225.84 weeks 1999-08-23 12.71 weeks 1999-07-03 NA NA weeks 1999-06-15 2008-03-25
8, Does it also fly? date of purchase (Date class) 4 0.00 2004-03-25 272.68 weeks 2004-04-06 347.46 weeks 1999-07-16 2008-08-25 475.428571 weeks 1999-07-16 2008-11-10
4, Does it come in green? date of purchase (Date class) 15 0.00 2003-07-23 243.88 weeks 1999-08-26 47.02 weeks 1999-03-24 2008-02-26 465.857143 weeks 1999-01-16 2008-10-13
6, Does it come in green? date of purchase (Date class) 3 0.00 2002-06-23 268.42 weeks 1999-09-09 27.75 weeks 1999-05-01 1999-09-09 18.714286 weeks 1999-05-01 2008-05-31
8, Does it come in green? date of purchase (Date class) 5 0.00 2006-07-09 217.62 weeks 2008-02-09 24.15 weeks 1999-02-01 2008-06-02 487.000000 weeks 1999-02-01 2008-12-08
4, I like this car! date of purchase (Date class) 8 11.11 2005-04-06 247.72 weeks 2008-07-29 20.33 weeks 1999-06-23 2008-09-23 482.857143 weeks 1999-06-08 2008-12-12
6, I like this car! date of purchase (Date class) 7 22.22 2002-01-30 232.78 weeks 1999-08-23 25.84 weeks 1999-04-23 2008-09-05 489.000000 weeks 1999-03-13 2008-09-05
8, I like this car! date of purchase (Date class) 4 0.00 2001-11-20 246.39 weeks 1999-09-27 30.61 weeks 1999-02-12 1999-11-28 41.285714 weeks 1999-02-12 2008-12-14
4, Meh. date of purchase (Date class) 6 0.00 1999-05-01 9.86 weeks 1999-04-25 8.47 weeks 1999-03-26 1999-05-16 7.285714 weeks 1999-01-25 1999-08-11
6, Meh. date of purchase (Date class) 6 0.00 2005-06-05 248.14 weeks 2008-04-27 26.58 weeks 1999-07-31 2008-05-08 457.714286 weeks 1999-01-05 2008-09-26
8, Meh. date of purchase (Date class) 5 16.67 2008-04-14 9.80 weeks 2008-04-15 11.44 weeks 2008-02-21 2008-05-27 13.714286 weeks 2008-01-27 2008-07-13
4, Missing date of purchase (Date class) 3 50.00 2002-08-26 280.92 weeks 1999-10-09 34.74 weeks 1999-10-09 NA NA weeks 1999-04-28 2008-11-11
6, Missing date of purchase (Date class) 5 0.00 2004-12-23 255.73 weeks 2008-05-24 21.18 weeks 1999-07-30 2008-08-09 471.142857 weeks 1999-07-30 2008-09-01
8, Missing date of purchase (Date class) 14 0.00 2005-11-13 226.66 weeks 2008-04-02 38.55 weeks 1999-10-04 2008-09-08 466.000000 weeks 1999-01-04 2008-11-15
4, This is the worst car ever! date of purchase (Date class) 7 0.00 2003-05-28 247.48 weeks 1999-11-24 50.62 weeks 1999-06-03 2008-02-10 453.428571 weeks 1999-03-30 2008-09-29
6, This is the worst car ever! date of purchase (Date class) 9 10.00 2002-08-03 237.70 weeks 1999-10-18 38.34 weeks 1999-04-20 2008-09-13 490.571429 weeks 1999-03-22 2008-10-26
8, This is the worst car ever! date of purchase (Date class) 5 0.00 2006-09-25 213.60 weeks 2008-07-04 16.10 weeks 1999-06-02 2008-09-18 485.142857 weeks 1999-06-02 2008-09-19
4, want cheese flavoured cars. date of purchase (Date class) 10 9.09 2003-02-13 238.91 weeks 1999-12-10 57.50 weeks 1999-06-09 2008-05-15 466.142857 weeks 1999-02-17 2008-10-31
6, want cheese flavoured cars. date of purchase (Date class) 13 0.00 2002-04-09 231.98 weeks 1999-08-31 36.85 weeks 1999-03-10 2008-06-24 484.857143 weeks 1999-01-26 2008-12-09
8, want cheese flavoured cars. date of purchase (Date class) 8 11.11 2005-01-02 240.53 weeks 2008-02-06 44.16 weeks 1999-05-21 2008-07-18 478.000000 weeks 1999-04-01 2008-10-18
Overall date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.714286 weeks 1999-01-04 2008-12-23
R NA Value date of purchase (Date class) 20 16.67 2003-12-06 236.95 weeks 2003-12-24 337.72 weeks 1999-08-14 2008-06-25 462.571429 weeks 1999-01-07 2008-12-03
make_complete_output(dpByCylByCommentsSummaryExample)
Summary statistics of date of purchase (Date class) by number of cylinders by some random comments.
number of cylinders by some random comments Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4, . date of purchase (Date class) 5 0.00 2003-01-27 252.39 weeks 1999-10-26 54.64 weeks 1999-02-10 2008-02-08 469.285714 weeks 1999-02-10 2008-08-12
6, . date of purchase (Date class) 9 0.00 2004-08-21 241.15 weeks 2008-04-02 44.27 weeks 1999-08-28 2008-06-18 459.571429 weeks 1999-07-14 2008-10-28
8, . date of purchase (Date class) 10 9.09 2004-11-28 246.03 weeks 2008-02-07 61.53 weeks 1999-10-05 2008-09-06 465.571429 weeks 1999-01-13 2008-11-27
4, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah date of purchase (Date class) 9 0.00 2002-08-10 241.71 weeks 1999-09-12 38.34 weeks 1999-03-15 2008-05-25 479.857143 weeks 1999-03-08 2008-12-23
6, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah date of purchase (Date class) 7 12.50 2004-08-16 254.96 weeks 2008-05-13 31.13 weeks 1999-06-07 2008-08-02 477.714286 weeks 1999-03-19 2008-10-07
8, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah date of purchase (Date class) 4 0.00 2004-01-07 274.68 weeks 2004-02-23 342.16 weeks 1999-02-03 2008-06-12 488.142857 weeks 1999-02-03 2008-09-09
4, Does it also fly? date of purchase (Date class) 5 0.00 2002-12-14 265.47 weeks 1999-08-06 43.21 weeks 1999-01-14 2008-02-14 474.000000 weeks 1999-01-14 2008-11-26
6, Does it also fly? date of purchase (Date class) 4 42.86 2001-09-28 225.84 weeks 1999-08-23 12.71 weeks 1999-07-03 NA NA weeks 1999-06-15 2008-03-25
8, Does it also fly? date of purchase (Date class) 4 0.00 2004-03-25 272.68 weeks 2004-04-06 347.46 weeks 1999-07-16 2008-08-25 475.428571 weeks 1999-07-16 2008-11-10
4, Does it come in green? date of purchase (Date class) 15 0.00 2003-07-23 243.88 weeks 1999-08-26 47.02 weeks 1999-03-24 2008-02-26 465.857143 weeks 1999-01-16 2008-10-13
6, Does it come in green? date of purchase (Date class) 3 0.00 2002-06-23 268.42 weeks 1999-09-09 27.75 weeks 1999-05-01 1999-09-09 18.714286 weeks 1999-05-01 2008-05-31
8, Does it come in green? date of purchase (Date class) 5 0.00 2006-07-09 217.62 weeks 2008-02-09 24.15 weeks 1999-02-01 2008-06-02 487.000000 weeks 1999-02-01 2008-12-08
4, I like this car! date of purchase (Date class) 8 11.11 2005-04-06 247.72 weeks 2008-07-29 20.33 weeks 1999-06-23 2008-09-23 482.857143 weeks 1999-06-08 2008-12-12
6, I like this car! date of purchase (Date class) 7 22.22 2002-01-30 232.78 weeks 1999-08-23 25.84 weeks 1999-04-23 2008-09-05 489.000000 weeks 1999-03-13 2008-09-05
8, I like this car! date of purchase (Date class) 4 0.00 2001-11-20 246.39 weeks 1999-09-27 30.61 weeks 1999-02-12 1999-11-28 41.285714 weeks 1999-02-12 2008-12-14
4, Meh. date of purchase (Date class) 6 0.00 1999-05-01 9.86 weeks 1999-04-25 8.47 weeks 1999-03-26 1999-05-16 7.285714 weeks 1999-01-25 1999-08-11
6, Meh. date of purchase (Date class) 6 0.00 2005-06-05 248.14 weeks 2008-04-27 26.58 weeks 1999-07-31 2008-05-08 457.714286 weeks 1999-01-05 2008-09-26
8, Meh. date of purchase (Date class) 5 16.67 2008-04-14 9.80 weeks 2008-04-15 11.44 weeks 2008-02-21 2008-05-27 13.714286 weeks 2008-01-27 2008-07-13
4, Missing date of purchase (Date class) 3 50.00 2002-08-26 280.92 weeks 1999-10-09 34.74 weeks 1999-10-09 NA NA weeks 1999-04-28 2008-11-11
6, Missing date of purchase (Date class) 5 0.00 2004-12-23 255.73 weeks 2008-05-24 21.18 weeks 1999-07-30 2008-08-09 471.142857 weeks 1999-07-30 2008-09-01
8, Missing date of purchase (Date class) 14 0.00 2005-11-13 226.66 weeks 2008-04-02 38.55 weeks 1999-10-04 2008-09-08 466.000000 weeks 1999-01-04 2008-11-15
4, This is the worst car ever! date of purchase (Date class) 7 0.00 2003-05-28 247.48 weeks 1999-11-24 50.62 weeks 1999-06-03 2008-02-10 453.428571 weeks 1999-03-30 2008-09-29
6, This is the worst car ever! date of purchase (Date class) 9 10.00 2002-08-03 237.70 weeks 1999-10-18 38.34 weeks 1999-04-20 2008-09-13 490.571429 weeks 1999-03-22 2008-10-26
8, This is the worst car ever! date of purchase (Date class) 5 0.00 2006-09-25 213.60 weeks 2008-07-04 16.10 weeks 1999-06-02 2008-09-18 485.142857 weeks 1999-06-02 2008-09-19
4, want cheese flavoured cars. date of purchase (Date class) 10 9.09 2003-02-13 238.91 weeks 1999-12-10 57.50 weeks 1999-06-09 2008-05-15 466.142857 weeks 1999-02-17 2008-10-31
6, want cheese flavoured cars. date of purchase (Date class) 13 0.00 2002-04-09 231.98 weeks 1999-08-31 36.85 weeks 1999-03-10 2008-06-24 484.857143 weeks 1999-01-26 2008-12-09
8, want cheese flavoured cars. date of purchase (Date class) 8 11.11 2005-01-02 240.53 weeks 2008-02-06 44.16 weeks 1999-05-21 2008-07-18 478.000000 weeks 1999-04-01 2008-10-18
Overall date of purchase (Date class) 213 8.58 2003-12-21 236.59 weeks 1999-12-24 74.98 weeks 1999-07-14 2008-09-01 476.714286 weeks 1999-01-04 2008-12-23
R NA Value date of purchase (Date class) 20 16.67 2003-12-06 236.95 weeks 2003-12-24 337.72 weeks 1999-08-14 2008-06-25 462.571429 weeks 1999-01-07 2008-12-03

Stacked barplot of date of purchase (Date class) by number of cylinders by some random comments.
show(dpltSummaryExample)
                              Label   N P NA                Mean       S Dev
1  date of purchase (POSIXlt class) 234 8.55 2003-11-15 13:01:05 234.3 weeks
                  Med         MAD              25th P              75th P
1 1999-12-16 04:23:30 67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51
             IQR                 Min                 Max
1 470.6033 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02

data_summary_table(dpltSummaryExample)
                              Label   N P NA                Mean       S Dev
1  date of purchase (POSIXlt class) 234 8.55 2003-11-15 13:01:05 234.3 weeks
                  Med         MAD              25th P              75th P
1 1999-12-16 04:23:30 67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51
             IQR                 Min                 Max
1 470.6033 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02
data_summary_plot(dpltSummaryExample)

make_kable_output(dpltSummaryExample)
Summary statistics of date of purchase (POSIXlt class).
Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
date of purchase (POSIXlt class) 234 8.55 2003-11-15 13:01:05 234.3 weeks 1999-12-16 04:23:30 67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51 470.6033 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02
make_complete_output(dpltSummaryExample)
Summary statistics of date of purchase (POSIXlt class).
Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
date of purchase (POSIXlt class) 234 8.55 2003-11-15 13:01:05 234.3 weeks 1999-12-16 04:23:30 67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51 470.6033 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02

Stacked barplot of date of purchase (Date class).
show(dpltByCylSummaryExample)
  number of cylinders                            Label   N  P NA
1                   4 date of purchase (POSIXlt class)  81  8.64
2                   5 date of purchase (POSIXlt class)   4  0.00
3                   6 date of purchase (POSIXlt class)  79  7.59
4                   8 date of purchase (POSIXlt class)  70 10.00
5             Overall date of purchase (POSIXlt class) 234  8.55
                 Mean        S Dev                 Med         MAD
1 2003-06-07 09:46:09 230.17 weeks 1999-11-21 23:21:30 44.34 weeks
2 2008-06-18 22:25:47  17.06 weeks 2008-06-19 02:08:01 21.71 weeks
3 2002-12-18 08:32:02 231.02 weeks 1999-09-23 08:05:00 38.02 weeks
4 2005-02-25 06:40:15 229.55 weeks 2008-02-28 14:28:40 52.72 weeks
5 2003-11-15 13:01:05 234.30 weeks 1999-12-16 04:23:30 67.67 weeks
               25th P              75th P             IQR                 Min
1 1999-08-17 07:59:00 2008-07-19 06:48:36 465.56444 weeks 1999-02-06 23:51:00
2 2008-02-24 08:01:04 2008-09-16 23:32:21  29.37215 weeks 2008-02-24 08:01:04
3 1999-06-01 05:12:00 2008-06-30 00:50:43 473.83122 weeks 1999-02-02 05:57:00
4 1999-08-03 00:23:00 2008-08-16 21:36:23 471.69776 weeks 1999-01-04 04:59:00
5 1999-07-17 10:42:00 2008-07-23 16:02:51 470.60326 weeks 1999-01-04 04:59:00
                  Max
1 2008-12-06 16:25:11
2 2008-10-12 04:26:02
3 2008-12-23 01:06:02
4 2008-12-15 06:26:36
5 2008-12-23 01:06:02

data_summary_table(dpltByCylSummaryExample)
  number of cylinders                            Label   N  P NA
1                   4 date of purchase (POSIXlt class)  81  8.64
2                   5 date of purchase (POSIXlt class)   4  0.00
3                   6 date of purchase (POSIXlt class)  79  7.59
4                   8 date of purchase (POSIXlt class)  70 10.00
5             Overall date of purchase (POSIXlt class) 234  8.55
                 Mean        S Dev                 Med         MAD
1 2003-06-07 09:46:09 230.17 weeks 1999-11-21 23:21:30 44.34 weeks
2 2008-06-18 22:25:47  17.06 weeks 2008-06-19 02:08:01 21.71 weeks
3 2002-12-18 08:32:02 231.02 weeks 1999-09-23 08:05:00 38.02 weeks
4 2005-02-25 06:40:15 229.55 weeks 2008-02-28 14:28:40 52.72 weeks
5 2003-11-15 13:01:05 234.30 weeks 1999-12-16 04:23:30 67.67 weeks
               25th P              75th P             IQR                 Min
1 1999-08-17 07:59:00 2008-07-19 06:48:36 465.56444 weeks 1999-02-06 23:51:00
2 2008-02-24 08:01:04 2008-09-16 23:32:21  29.37215 weeks 2008-02-24 08:01:04
3 1999-06-01 05:12:00 2008-06-30 00:50:43 473.83122 weeks 1999-02-02 05:57:00
4 1999-08-03 00:23:00 2008-08-16 21:36:23 471.69776 weeks 1999-01-04 04:59:00
5 1999-07-17 10:42:00 2008-07-23 16:02:51 470.60326 weeks 1999-01-04 04:59:00
                  Max
1 2008-12-06 16:25:11
2 2008-10-12 04:26:02
3 2008-12-23 01:06:02
4 2008-12-15 06:26:36
5 2008-12-23 01:06:02
data_summary_plot(dpltByCylSummaryExample)

make_kable_output(dpltByCylSummaryExample)
Summary statistics of date of purchase (POSIXlt class) by number of cylinders.
number of cylinders Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4 date of purchase (POSIXlt class) 81 8.64 2003-06-07 09:46:09 230.17 weeks 1999-11-21 23:21:30 44.34 weeks 1999-08-17 07:59:00 2008-07-19 06:48:36 465.56444 weeks 1999-02-06 23:51:00 2008-12-06 16:25:11
5 date of purchase (POSIXlt class) 4 0.00 2008-06-18 22:25:47 17.06 weeks 2008-06-19 02:08:01 21.71 weeks 2008-02-24 08:01:04 2008-09-16 23:32:21 29.37215 weeks 2008-02-24 08:01:04 2008-10-12 04:26:02
6 date of purchase (POSIXlt class) 79 7.59 2002-12-18 08:32:02 231.02 weeks 1999-09-23 08:05:00 38.02 weeks 1999-06-01 05:12:00 2008-06-30 00:50:43 473.83122 weeks 1999-02-02 05:57:00 2008-12-23 01:06:02
8 date of purchase (POSIXlt class) 70 10.00 2005-02-25 06:40:15 229.55 weeks 2008-02-28 14:28:40 52.72 weeks 1999-08-03 00:23:00 2008-08-16 21:36:23 471.69776 weeks 1999-01-04 04:59:00 2008-12-15 06:26:36
Overall date of purchase (POSIXlt class) 234 8.55 2003-11-15 13:01:05 234.30 weeks 1999-12-16 04:23:30 67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51 470.60326 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02
make_complete_output(dpltByCylSummaryExample)
Summary statistics of date of purchase (POSIXlt class) by number of cylinders.
number of cylinders Label N P NA Mean S Dev Med MAD 25th P 75th P IQR Min Max
4 date of purchase (POSIXlt class) 81 8.64 2003-06-07 09:46:09 230.17 weeks 1999-11-21 23:21:30 44.34 weeks 1999-08-17 07:59:00 2008-07-19 06:48:36 465.56444 weeks 1999-02-06 23:51:00 2008-12-06 16:25:11
5 date of purchase (POSIXlt class) 4 0.00 2008-06-18 22:25:47 17.06 weeks 2008-06-19 02:08:01 21.71 weeks 2008-02-24 08:01:04 2008-09-16 23:32:21 29.37215 weeks 2008-02-24 08:01:04 2008-10-12 04:26:02
6 date of purchase (POSIXlt class) 79 7.59 2002-12-18 08:32:02 231.02 weeks 1999-09-23 08:05:00 38.02 weeks 1999-06-01 05:12:00 2008-06-30 00:50:43 473.83122 weeks 1999-02-02 05:57:00 2008-12-23 01:06:02
8 date of purchase (POSIXlt class) 70 10.00 2005-02-25 06:40:15 229.55 weeks 2008-02-28 14:28:40 52.72 weeks 1999-08-03 00:23:00 2008-08-16 21:36:23 471.69776 weeks 1999-01-04 04:59:00 2008-12-15 06:26:36
Overall date of purchase (POSIXlt class) 234 8.55 2003-11-15 13:01:05 234.30 weeks 1999-12-16 04:23:30 67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51 470.60326 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02

Stacked barplot of date of purchase (Date class) by number of cylinders.
show(dpltByCylByCommentsSummaryExample)
         number of cylinders by some random comments
1                                               4, .
2                                               6, .
3                                               8, .
4  4, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
5  6, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
6  8, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
7                               4, Does it also fly?
8                               6, Does it also fly?
9                               8, Does it also fly?
10                         4, Does it come in green?
11                         6, Does it come in green?
12                         8, Does it come in green?
13                               4, I like this car!
14                               6, I like this car!
15                               8, I like this car!
16                                           4, Meh.
17                                           6, Meh.
18                                           8, Meh.
19                                        4, Missing
20                                        6, Missing
21                                        8, Missing
22                    4, This is the worst car ever!
23                    6, This is the worst car ever!
24                    8, This is the worst car ever!
25                    4, want cheese flavoured cars.
26                    6, want cheese flavoured cars.
27                    8, want cheese flavoured cars.
28                                           Overall
29                                        R NA Value
                              Label   N  P NA                Mean        S Dev
1  date of purchase (POSIXlt class)   5  0.00 2002-12-26 13:38:31 260.08 weeks
2  date of purchase (POSIXlt class)   9 11.11 2003-12-31 07:58:18 247.12 weeks
3  date of purchase (POSIXlt class)  11  0.00 2004-05-29 02:24:54 245.48 weeks
4  date of purchase (POSIXlt class)   9  0.00 2002-06-23 10:51:45 223.34 weeks
5  date of purchase (POSIXlt class)   8 12.50 2004-07-24 21:46:13 261.15 weeks
6  date of purchase (POSIXlt class)   4 50.00 2008-05-14 06:42:44   2.05 weeks
7  date of purchase (POSIXlt class)   5  0.00 2003-03-07 13:02:00 254.76 weeks
8  date of purchase (POSIXlt class)   7 14.29 2000-12-31 00:40:43 201.17 weeks
9  date of purchase (POSIXlt class)   4  0.00 2003-12-13 22:25:46 278.25 weeks
10 date of purchase (POSIXlt class)  15  6.67 2003-06-16 07:56:21 236.42 weeks
11 date of purchase (POSIXlt class)   3  0.00 2002-06-30 09:12:42 270.33 weeks
12 date of purchase (POSIXlt class)   5  0.00 2006-10-07 04:49:16 212.99 weeks
13 date of purchase (POSIXlt class)  10  0.00 2004-11-13 07:26:51 239.01 weeks
14 date of purchase (POSIXlt class)   9  0.00 2001-07-09 08:24:32 208.13 weeks
15 date of purchase (POSIXlt class)   4  0.00 2001-07-01 16:33:59 239.79 weeks
16 date of purchase (POSIXlt class)   6  0.00 1999-08-25 13:01:40   9.25 weeks
17 date of purchase (POSIXlt class)   6  0.00 2005-06-27 06:16:57 237.83 weeks
18 date of purchase (POSIXlt class)   6 16.67 2008-04-25 10:42:01   7.88 weeks
19 date of purchase (POSIXlt class)   6 33.33 2004-02-24 10:35:52 267.91 weeks
20 date of purchase (POSIXlt class)   5  0.00 2004-10-25 02:13:27 267.95 weeks
21 date of purchase (POSIXlt class)  14 14.29 2006-04-18 07:42:10 206.29 weeks
22 date of purchase (POSIXlt class)   7  0.00 2003-04-05 22:54:10 245.37 weeks
23 date of purchase (POSIXlt class)  10 10.00 2002-08-17 06:20:29 241.20 weeks
24 date of purchase (POSIXlt class)   5  0.00 2006-08-16 09:39:48 207.93 weeks
25 date of purchase (POSIXlt class)  11 36.36 2004-09-23 19:01:28 249.43 weeks
26 date of purchase (POSIXlt class)  13  7.69 2001-10-13 09:39:46 206.72 weeks
27 date of purchase (POSIXlt class)   9 22.22 2004-09-01 04:43:02 260.61 weeks
28 date of purchase (POSIXlt class) 234  8.55 2003-11-15 13:01:05 234.30 weeks
29 date of purchase (POSIXlt class)  24  4.17 2003-05-14 06:30:18 237.27 weeks
                   Med          MAD              25th P              75th P
1  1999-06-24 10:05:00  17.72 weeks 1999-04-01 16:49:00 2008-05-04 14:32:00
2  2004-01-11 07:48:34 340.15 weeks 1999-06-21 15:04:00 2008-05-07 12:07:04
3  2008-01-08 08:48:50  69.28 weeks 1999-06-17 20:51:00 2008-06-16 11:15:19
4  1999-11-10 03:37:00  28.85 weeks 1999-06-26 23:47:00 2008-01-01 21:17:41
5  2008-04-06 05:33:44  50.36 weeks 1999-03-18 09:04:00 2008-09-11 12:16:05
6  2008-05-14 06:42:44   2.15 weeks 2008-05-04 03:11:56                <NA>
7  1999-12-03 14:02:00  46.46 weeks 1999-04-28 07:00:00 2008-02-04 15:09:51
8  1999-05-30 17:24:30  12.40 weeks 1999-05-05 06:29:00 1999-10-26 18:15:00
9  2003-11-02 13:02:39 348.06 weeks 1999-04-03 04:24:00 2008-04-01 22:16:18
10 1999-11-24 15:28:30  39.39 weeks 1999-09-02 06:35:00 2008-07-23 16:02:51
11 1999-08-29 04:43:00  23.66 weeks 1999-05-09 12:09:00 1999-08-29 04:43:00
12 2008-04-16 10:43:47  42.60 weeks 1999-06-27 02:00:00 2008-11-03 12:36:31
13 2008-02-20 02:59:31  43.53 weeks 1999-07-19 02:45:00 2008-06-06 00:16:30
14 1999-09-01 03:08:00  21.11 weeks 1999-05-20 05:21:00 1999-10-17 20:26:00
15 1999-03-21 09:08:00   2.24 weeks 1999-03-03 10:20:00 1999-03-24 14:33:00
16 1999-08-29 00:33:00   6.94 weeks 1999-08-04 17:17:00 1999-09-09 17:07:00
17 2008-05-07 16:52:30  12.18 weeks 1999-10-01 22:39:00 2008-06-02 22:26:13
18 2008-04-22 04:39:45   4.67 weeks 2008-03-31 03:48:18 2008-05-06 11:35:30
19 2004-02-24 04:39:56 343.94 weeks 1999-09-16 13:56:00 2008-08-08 08:13:36
20 2008-07-21 14:26:31   2.15 weeks 1999-02-23 01:03:00 2008-07-24 04:53:54
21 2008-05-04 23:11:45  28.88 weeks 2008-01-15 10:13:33 2008-10-14 03:45:41
22 1999-10-03 20:59:00  40.91 weeks 1999-04-01 16:56:00 2008-02-06 14:44:36
23 1999-09-23 08:05:00  31.28 weeks 1999-04-28 15:16:00 2008-11-24 04:28:26
24 2008-05-16 15:45:50  18.25 weeks 1999-07-03 08:38:00 2008-06-23 14:12:36
25 2008-02-20 02:52:27  51.90 weeks 1999-09-24 23:41:00                <NA>
26 1999-09-17 07:54:30  16.31 weeks 1999-07-02 02:34:00 2008-04-01 22:06:18
27 2008-01-19 02:34:35  67.07 weeks 1999-06-20 14:17:00 2008-11-30 18:38:11
28 1999-12-16 04:23:30  67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51
29 1999-12-02 03:54:00  64.95 weeks 1999-04-07 12:51:00 2008-05-14 11:48:26
                IQR                 Min                 Max
1  474.409028 weeks 1999-04-01 16:49:00 2008-07-19 06:48:36
2  463.268161 weeks 1999-06-01 05:12:00 2008-11-12 17:56:39
3  469.514317 weeks 1999-01-31 21:39:00 2008-11-30 10:47:06
4  444.419711 weeks 1999-02-06 23:51:00 2008-06-22 02:19:06
5  495.013104 weeks 1999-02-02 05:57:00 2008-11-29 23:22:31
6          NA weeks 2008-05-04 03:11:56 2008-05-24 10:13:33
7  457.768834 weeks 1999-04-28 07:00:00 2008-12-06 16:25:11
8   24.927183 weeks 1999-02-28 00:08:00 2008-11-08 20:23:21
9  469.528998 weeks 1999-04-03 04:24:00 2008-11-15 11:13:47
10 463.913477 weeks 1999-05-08 12:54:00 2008-10-21 21:32:53
11  15.955754 weeks 1999-05-09 12:09:00 2008-06-22 10:46:07
12 488.211956 weeks 1999-06-27 02:00:00 2008-12-13 19:57:34
13 463.556696 weeks 1999-05-25 09:23:00 2008-09-27 23:41:44
14  21.518353 weeks 1999-04-06 05:38:00 2008-12-23 01:06:02
15   3.025099 weeks 1999-03-03 10:20:00 2008-05-23 10:39:59
16   5.141865 weeks 1999-05-07 21:04:00 1999-11-12 08:41:00
17 452.427303 weeks 1999-06-17 19:37:00 2008-07-19 03:28:08
18   5.189206 weeks 2008-02-19 04:00:08 2008-07-18 04:26:27
19 464.108889 weeks 1999-09-12 02:50:00 2008-08-08 08:13:36
20 491.302669 weeks 1999-02-23 01:03:00 2008-07-31 17:39:54
21  38.955569 weeks 1999-08-03 00:23:00 2008-12-15 06:26:36
22 461.844107 weeks 1999-03-24 16:04:00 2008-06-16 20:57:55
23 499.655995 weeks 1999-02-22 04:55:00 2008-11-29 02:51:30
24 468.318909 weeks 1999-07-03 08:38:00 2008-08-16 21:36:23
25         NA weeks 1999-07-17 10:42:00 2008-10-22 04:49:26
26 456.687728 weeks 1999-02-02 06:27:00 2008-06-30 00:50:43
27 493.031863 weeks 1999-01-06 16:15:00 2008-11-30 18:38:11
28 470.603259 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02
29 474.993793 weeks 1999-01-04 04:59:00 2008-10-23 19:14:24

data_summary_table(dpltByCylByCommentsSummaryExample)
         number of cylinders by some random comments
1                                               4, .
2                                               6, .
3                                               8, .
4  4, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
5  6, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
6  8, Blah, Blah, Blah, Blah, Blah, Blah, Blah, Blah
7                               4, Does it also fly?
8                               6, Does it also fly?
9                               8, Does it also fly?
10                         4, Does it come in green?
11                         6, Does it come in green?
12                         8, Does it come in green?
13                               4, I like this car!
14                               6, I like this car!
15                               8, I like this car!
16                                           4, Meh.
17                                           6, Meh.
18                                           8, Meh.
19                                        4, Missing
20                                        6, Missing
21                                        8, Missing
22                    4, This is the worst car ever!
23                    6, This is the worst car ever!
24                    8, This is the worst car ever!
25                    4, want cheese flavoured cars.
26                    6, want cheese flavoured cars.
27                    8, want cheese flavoured cars.
28                                           Overall
29                                        R NA Value
                              Label   N  P NA                Mean        S Dev
1  date of purchase (POSIXlt class)   5  0.00 2002-12-26 13:38:31 260.08 weeks
2  date of purchase (POSIXlt class)   9 11.11 2003-12-31 07:58:18 247.12 weeks
3  date of purchase (POSIXlt class)  11  0.00 2004-05-29 02:24:54 245.48 weeks
4  date of purchase (POSIXlt class)   9  0.00 2002-06-23 10:51:45 223.34 weeks
5  date of purchase (POSIXlt class)   8 12.50 2004-07-24 21:46:13 261.15 weeks
6  date of purchase (POSIXlt class)   4 50.00 2008-05-14 06:42:44   2.05 weeks
7  date of purchase (POSIXlt class)   5  0.00 2003-03-07 13:02:00 254.76 weeks
8  date of purchase (POSIXlt class)   7 14.29 2000-12-31 00:40:43 201.17 weeks
9  date of purchase (POSIXlt class)   4  0.00 2003-12-13 22:25:46 278.25 weeks
10 date of purchase (POSIXlt class)  15  6.67 2003-06-16 07:56:21 236.42 weeks
11 date of purchase (POSIXlt class)   3  0.00 2002-06-30 09:12:42 270.33 weeks
12 date of purchase (POSIXlt class)   5  0.00 2006-10-07 04:49:16 212.99 weeks
13 date of purchase (POSIXlt class)  10  0.00 2004-11-13 07:26:51 239.01 weeks
14 date of purchase (POSIXlt class)   9  0.00 2001-07-09 08:24:32 208.13 weeks
15 date of purchase (POSIXlt class)   4  0.00 2001-07-01 16:33:59 239.79 weeks
16 date of purchase (POSIXlt class)   6  0.00 1999-08-25 13:01:40   9.25 weeks
17 date of purchase (POSIXlt class)   6  0.00 2005-06-27 06:16:57 237.83 weeks
18 date of purchase (POSIXlt class)   6 16.67 2008-04-25 10:42:01   7.88 weeks
19 date of purchase (POSIXlt class)   6 33.33 2004-02-24 10:35:52 267.91 weeks
20 date of purchase (POSIXlt class)   5  0.00 2004-10-25 02:13:27 267.95 weeks
21 date of purchase (POSIXlt class)  14 14.29 2006-04-18 07:42:10 206.29 weeks
22 date of purchase (POSIXlt class)   7  0.00 2003-04-05 22:54:10 245.37 weeks
23 date of purchase (POSIXlt class)  10 10.00 2002-08-17 06:20:29 241.20 weeks
24 date of purchase (POSIXlt class)   5  0.00 2006-08-16 09:39:48 207.93 weeks
25 date of purchase (POSIXlt class)  11 36.36 2004-09-23 19:01:28 249.43 weeks
26 date of purchase (POSIXlt class)  13  7.69 2001-10-13 09:39:46 206.72 weeks
27 date of purchase (POSIXlt class)   9 22.22 2004-09-01 04:43:02 260.61 weeks
28 date of purchase (POSIXlt class) 234  8.55 2003-11-15 13:01:05 234.30 weeks
29 date of purchase (POSIXlt class)  24  4.17 2003-05-14 06:30:18 237.27 weeks
                   Med          MAD              25th P              75th P
1  1999-06-24 10:05:00  17.72 weeks 1999-04-01 16:49:00 2008-05-04 14:32:00
2  2004-01-11 07:48:34 340.15 weeks 1999-06-21 15:04:00 2008-05-07 12:07:04
3  2008-01-08 08:48:50  69.28 weeks 1999-06-17 20:51:00 2008-06-16 11:15:19
4  1999-11-10 03:37:00  28.85 weeks 1999-06-26 23:47:00 2008-01-01 21:17:41
5  2008-04-06 05:33:44  50.36 weeks 1999-03-18 09:04:00 2008-09-11 12:16:05
6  2008-05-14 06:42:44   2.15 weeks 2008-05-04 03:11:56                <NA>
7  1999-12-03 14:02:00  46.46 weeks 1999-04-28 07:00:00 2008-02-04 15:09:51
8  1999-05-30 17:24:30  12.40 weeks 1999-05-05 06:29:00 1999-10-26 18:15:00
9  2003-11-02 13:02:39 348.06 weeks 1999-04-03 04:24:00 2008-04-01 22:16:18
10 1999-11-24 15:28:30  39.39 weeks 1999-09-02 06:35:00 2008-07-23 16:02:51
11 1999-08-29 04:43:00  23.66 weeks 1999-05-09 12:09:00 1999-08-29 04:43:00
12 2008-04-16 10:43:47  42.60 weeks 1999-06-27 02:00:00 2008-11-03 12:36:31
13 2008-02-20 02:59:31  43.53 weeks 1999-07-19 02:45:00 2008-06-06 00:16:30
14 1999-09-01 03:08:00  21.11 weeks 1999-05-20 05:21:00 1999-10-17 20:26:00
15 1999-03-21 09:08:00   2.24 weeks 1999-03-03 10:20:00 1999-03-24 14:33:00
16 1999-08-29 00:33:00   6.94 weeks 1999-08-04 17:17:00 1999-09-09 17:07:00
17 2008-05-07 16:52:30  12.18 weeks 1999-10-01 22:39:00 2008-06-02 22:26:13
18 2008-04-22 04:39:45   4.67 weeks 2008-03-31 03:48:18 2008-05-06 11:35:30
19 2004-02-24 04:39:56 343.94 weeks 1999-09-16 13:56:00 2008-08-08 08:13:36
20 2008-07-21 14:26:31   2.15 weeks 1999-02-23 01:03:00 2008-07-24 04:53:54
21 2008-05-04 23:11:45  28.88 weeks 2008-01-15 10:13:33 2008-10-14 03:45:41
22 1999-10-03 20:59:00  40.91 weeks 1999-04-01 16:56:00 2008-02-06 14:44:36
23 1999-09-23 08:05:00  31.28 weeks 1999-04-28 15:16:00 2008-11-24 04:28:26
24 2008-05-16 15:45:50  18.25 weeks 1999-07-03 08:38:00 2008-06-23 14:12:36
25 2008-02-20 02:52:27  51.90 weeks 1999-09-24 23:41:00                <NA>
26 1999-09-17 07:54:30  16.31 weeks 1999-07-02 02:34:00 2008-04-01 22:06:18
27 2008-01-19 02:34:35  67.07 weeks 1999-06-20 14:17:00 2008-11-30 18:38:11
28 1999-12-16 04:23:30  67.67 weeks 1999-07-17 10:42:00 2008-07-23 16:02:51
29 1999-12-02 03:54:00  64.95 weeks 1999-04-07 12:51:00 2008-05-14 11:48:26
                IQR                 Min                 Max
1  474.409028 weeks 1999-04-01 16:49:00 2008-07-19 06:48:36
2  463.268161 weeks 1999-06-01 05:12:00 2008-11-12 17:56:39
3  469.514317 weeks 1999-01-31 21:39:00 2008-11-30 10:47:06
4  444.419711 weeks 1999-02-06 23:51:00 2008-06-22 02:19:06
5  495.013104 weeks 1999-02-02 05:57:00 2008-11-29 23:22:31
6          NA weeks 2008-05-04 03:11:56 2008-05-24 10:13:33
7  457.768834 weeks 1999-04-28 07:00:00 2008-12-06 16:25:11
8   24.927183 weeks 1999-02-28 00:08:00 2008-11-08 20:23:21
9  469.528998 weeks 1999-04-03 04:24:00 2008-11-15 11:13:47
10 463.913477 weeks 1999-05-08 12:54:00 2008-10-21 21:32:53
11  15.955754 weeks 1999-05-09 12:09:00 2008-06-22 10:46:07
12 488.211956 weeks 1999-06-27 02:00:00 2008-12-13 19:57:34
13 463.556696 weeks 1999-05-25 09:23:00 2008-09-27 23:41:44
14  21.518353 weeks 1999-04-06 05:38:00 2008-12-23 01:06:02
15   3.025099 weeks 1999-03-03 10:20:00 2008-05-23 10:39:59
16   5.141865 weeks 1999-05-07 21:04:00 1999-11-12 08:41:00
17 452.427303 weeks 1999-06-17 19:37:00 2008-07-19 03:28:08
18   5.189206 weeks 2008-02-19 04:00:08 2008-07-18 04:26:27
19 464.108889 weeks 1999-09-12 02:50:00 2008-08-08 08:13:36
20 491.302669 weeks 1999-02-23 01:03:00 2008-07-31 17:39:54
21  38.955569 weeks 1999-08-03 00:23:00 2008-12-15 06:26:36
22 461.844107 weeks 1999-03-24 16:04:00 2008-06-16 20:57:55
23 499.655995 weeks 1999-02-22 04:55:00 2008-11-29 02:51:30
24 468.318909 weeks 1999-07-03 08:38:00 2008-08-16 21:36:23
25         NA weeks 1999-07-17 10:42:00 2008-10-22 04:49:26
26 456.687728 weeks 1999-02-02 06:27:00 2008-06-30 00:50:43
27 493.031863 weeks 1999-01-06 16:15:00 2008-11-30 18:38:11
28 470.603259 weeks 1999-01-04 04:59:00 2008-12-23 01:06:02
29 474.993793 weeks 1999-01-04 04:59:00 2008-10-23 19:14:24
data_summary_plot(dpltByCylByCommentsSummaryExample)