Learn R Programming

report (version 0.1.0)

report.character: Data frame Report

Description

Create a report of a data frame.

Usage

# S3 method for character
report(
  model,
  n_entries = 3,
  levels_percentage = FALSE,
  missing_percentage = FALSE,
  ...
)

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

# S3 method for factor report(model, levels_percentage = FALSE, ...)

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

Arguments

model

A data.frame or a vector.

n_entries

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

levels_percentage

Show characters entries and factor levels by number (default) or percentage.

missing_percentage

Show missings by number (default) or percentage.

...

Arguments passed to or from other methods.

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

Returns kurtosis and skewness in table.

digits

Number of significant digits.

Value

A list-object of class report, which contains further list-objects with a short and long description of the model summary, as well as a short and long table of parameters and fit indices.

See Also

report

Examples

Run this code
# NOT RUN {
x <- c("A", "B", "C", "A", "B", "B", "D", "E", "B", "D", "A")
report(x)
model_table(x)
model_text(x)
summary(model_table(x))
summary(model_text(x))
library(report)

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

if (require("dplyr")) {
  r <- iris %>%
    dplyr::group_by(Species) %>%
    report()
  r
  summary(r)
  as.data.frame(r)
  summary(as.data.frame(r))
}
x <- factor(rep(c("A", "B", "C"), 10))
report(x)
model_table(x)
model_text(x)
summary(model_table(x))
summary(model_text(x))
x <- rnorm(1000)
report(x)
report(x, centrality = "median", missing_percentage = TRUE, distribution = TRUE)
model_table(x)
model_text(x)
summary(model_table(x))
summary(model_text(x))
# }

Run the code above in your browser using DataLab