Learn R Programming

report (version 0.6.0)

report.character: Reporting Datasets and Dataframes

Description

Create reports for data frames.

Usage

# S3 method for character
report(
  x,
  n_entries = 3,
  levels_percentage = "auto",
  missing_percentage = "auto",
  ...
)

# S3 method for data.frame report( x, n = FALSE, centrality = "mean", dispersion = TRUE, range = TRUE, distribution = FALSE, levels_percentage = "auto", digits = 2, n_entries = 3, missing_percentage = "auto", ... )

# S3 method for factor report(x, levels_percentage = "auto", ...)

# S3 method for numeric report( x, n = FALSE, centrality = "mean", dispersion = TRUE, range = TRUE, distribution = FALSE, missing_percentage = "auto", digits = 2, ... )

Value

An object of class report().

Arguments

x

The R object that you want to report (see list of of supported objects above).

n_entries

Number of different character entries to show. Can be "all".

levels_percentage

Show characters entries and factor levels by number or percentage. If "auto", then will be set to number and percentage if the length if n observations larger than 100.

missing_percentage

Show missing by number (default) or percentage. If "auto", then will be set to number and percentage if the length if n observations larger than 100.

...

Arguments passed to or from other methods.

n

Include number of observations for each individual variable.

centrality

Character vector, indicating the index of centrality (either "mean" or "median").

dispersion

Show index of dispersion (sd if centrality = "mean", or mad if centrality = "median").

range

Show range.

distribution

Show kurtosis and skewness.

digits

Number of significant digits.

Examples

Run this code
r <- report(iris,
  centrality = "median", dispersion = FALSE,
  distribution = TRUE, missing_percentage = TRUE
)
r
summary(r)
as.data.frame(r)
summary(as.data.frame(r))

# grouped analysis using `{dplyr}` package
library(dplyr)
r <- iris %>%
  group_by(Species) %>%
  report()
r
summary(r)
as.data.frame(r)
summary(as.data.frame(r))

Run the code above in your browser using DataLab