report.data.frame: Reporting Datasets and Dataframes

View source: R/report.data.frame.R

report.characterR Documentation

Reporting Datasets and Dataframes

Description

Create reports for data frames.

Usage

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

## S3 method for class '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 class 'factor'
report(x, levels_percentage = "auto", ...)

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

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.

Value

An object of class report().

Examples

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))


report documentation built on Sept. 11, 2024, 8:47 p.m.