Learn R Programming

report (version 0.4.0)

report_text: Report a textual description of an object

Description

Creates text containing a description of the parameters of R objects (see list of supported objects in report()).

Usage

report_text(x, table = NULL, ...)

Arguments

x

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

table

A table obtained via report_table(). If not provided, will run it.

...

Arguments passed to or from other methods.

Value

An object of class report_text().

Examples

Run this code
# NOT RUN {
library(report)

# Miscellaneous
r <- report_text(sessionInfo())
r
summary(r)

# Data
report_text(iris$Sepal.Length)
report_text(as.character(round(iris$Sepal.Length, 1)))
report_text(iris$Species)
report_text(iris)

# h-tests
report_text(t.test(iris$Sepal.Width, iris$Sepal.Length))

# ANOVA
r <- report_text(aov(Sepal.Length ~ Species, data = iris))
r
summary(r)

# GLMs
r <- report_text(lm(Sepal.Length ~ Petal.Length * Species, data = iris))
r
summary(r)
# }
# NOT RUN {
if (require("lme4")) {
  model <- lme4::lmer(Sepal.Length ~ Petal.Length + (1 | Species), data = iris)
  r <- report_text(model)
  r
  summary(r)
}

# Bayesian models
if (require("rstanarm")) {
  model <- stan_glm(mpg ~ cyl + wt, data = mtcars, refresh = 0, iter = 600)
  r <- report_text(model)
  r
  summary(r)
}
# }

Run the code above in your browser using DataLab