huxtable (version 4.6.0)

tidy_override: Override a model's tidy output

Description

Use tidy_override to provide your own p values, confidence intervals etc. for a model.

Usage

tidy_override(x, ..., glance = list(), extend = FALSE)

# S3 method for tidy_override tidy(x, ...)

# S3 method for tidy_override glance(x, ...)

# S3 method for tidy_override nobs(object, ...)

Arguments

x

A model with methods defined for generics::tidy() and/or generics::glance().

...

In tidy_override, columns of statistics to replace tidy output. In tidy and glance methods, arguments passed on to the underlying model.

glance

A list of summary statistics for glance.

extend

Logical: allow adding new statistics?

object

A tidy_override object.

Value

An object of class "tidy_override". When tidy and glance are called on this, it will return results from the underlying model, replacing some columns with your own data.

Examples

Run this code
# NOT RUN {
if (! requireNamespace("broom")) {
  stop("Please install 'broom' to run this example.")
}

lm1 <- lm(mpg ~ cyl, mtcars)
fixed_lm1 <- tidy_override(lm1,
      p.value = c(.04, .12),
      glance = list(r.squared = 0.99))

broom::tidy(fixed_lm1)

cbind(huxreg(fixed_lm1), huxreg(lm1))
# }

Run the code above in your browser using DataCamp Workspace