full_summary: Full summarisation of a data frame

Description Usage Arguments Author(s) Examples

View source: R/full_summary.R

Description

A helper function to provide full summaries/tables of a data frame, summarises mean, median and quantiles for numerical/date vectors and tables for character/categorical vectors. To be prettified.

Usage

1
full_summary(data, useNA = "always", table_max_cat = 5)

Arguments

data

Your data frame.

useNA

whether to include NA values in the tables, defaults to "always". Use "no" to hide NA's and "ifany" to show only if there are any.

table_max_cat

Defines how large tables (dimensions) are shown, defaults to max 5 categories. For vectors with more than given categories shows number of unique values and number of missing records.

Author(s)

Tommi Karki

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mydat <- data.frame(ID = c(seq(1,10,1)),
Gender = c(rep(c("F", "M"),5)),
AgeGroup = c(rep(c("0-18", "18-65", "65+"),3), "65+"),
Case = c(1,1,1,0,0,1,1,1,1,1),
DateOfOnset = as.Date(c("2017-06-11", "2017-06-11", 
                       "2017-06-11", NA, NA, "2017-06-10", 
                       "2017-06-14", "2017-06-14",
                       "2017-06-19", "2017-06-19")),
Month = c(sample(c(3:6),5, replace = TRUE), sample(c(1:12),5)),
Week = c(sample(c(10:12),5, replace = TRUE), sample(c(1:53),5)))

# Summaries/tables of all variables
full_summary(mydat)

TommiKarki/EpiMethods documentation built on Dec. 6, 2019, 4:48 a.m.