light_table: Produce latex tables from stripped objects to reduce memory...

Description Usage Arguments Details Value Examples

View source: R/light_table.R

Description

Produce latex tables from stripped objects to reduce memory needs

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
light_table(
  object,
  type = c("latex", "html"),
  modeltype = "outcome",
  title = "Title",
  label = "label",
  dep.var.labels = "Label dep.var.labels",
  dep.var.separate = NULL,
  column.labels = "blab",
  covariate.labels = NULL,
  order_variable = NULL,
  stats.var.separate = NULL,
  stats.list = c("n", "lln", "bic"),
  stats.digits = 3L,
  stats.add = NULL,
  notes = "notes to add",
  add.lines = NULL,
  reference_level_position = NULL,
  rules_between_covariates = NULL,
  omit = NULL,
  landscape = FALSE,
  adjustbox_width = c(NULL, 1.1),
  visualize = FALSE,
  footprint = FALSE,
  ...
)

Arguments

object

List of object

type

Reporting output used. Accepted values are latex and html

modeltype

Character vectors indicating whether we should use selection or outcome object. Ignored if object is not zeroinfl

title

Table caption

label

Table label

dep.var.labels

Label for dependent variables

dep.var.separate

Numeric vector that specifies how dep.var.labels should be laid out across regression table columns. A value of c(2, 1, 3), for instance, will apply the first label to the two first columns, the second label to the third column, and the third label will apply to the following three columns (i.e., columns number four, five and six).

column.labels

Label for columns

covariate.labels

A character vector of labels for columns in regression tables. Their layout, in terms of the number of columns associated with each label, is given by the argument column.separate.

order_variable

A vector that indicates the order in which variables will appear in the output.

stats.var.separate

Numeric vector that specifies how statistics should be laid out across regression table columns. A value of c(2, 1, 3), for instance, will apply the first statistics to the two first columns, the second statistics to the third column, and the statistics will apply to the following three columns (i.e., columns number four, five and six).

stats.list

A character vector that specifies which model statistics should be kept in the regression table output. See details section

stats.digits

Number of digits in relevent statistics

stats.add

User-defined additional statistics. See #69. For the moment, only possible to provide a string, e.g. c("Stat1 & Yes & No", "Details & Full & Small")

notes

Notes that should be added at the end

add.lines

Rows to add in object statistics part

reference_level_position

In multinomial logit, coefficients are relative to the reference level. A column can be added to represent an empty coefficient modality that is indicated as being the reference. If NULL, this feature is ignored. Otherwise, the column is placed at the position indicated by the argument

rules_between_covariates

A numeric vector that specifies how rules should be laid out across rows of the regression table

omit

List of variables that should be removed from the table

landscape

Logical value indicating whether we want to use a landscape table. Default to FALSE

adjustbox_width

If the table needs to be adjusted to page width, what should be the parameter ?

visualize

Logical condition indicating whether we want to print the table on Rstudio viewer. Ignored if type = latex

footprint

Should we write the footprint at the head of the table

This function is designed to produce latex tables with stripped objects (see strip). It follows stargazer standards but proposes a simplified framework. Customization is limited

...

Additional arguments that should be passed. See, for instance, liststats

Details

The statistics that are accepted are, for the moment:

Value

A character vector. The table is printed in the viewer if type is html and visualize is TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: data("bioChemists", package = "pscl")

fm_zip    <- pscl::zeroinfl(art ~ . | ., data = bioChemists)
fm_zip2   <- pscl::zeroinfl(art ~ 1 | ., data = bioChemists)
glm_model <- glm(art ~ . , data = bioChemists)
fm_zip3   <- pscl::zeroinfl(art ~ 1 | ., data = bioChemists,
                            dist = "negbin")
fm_zip5   <- MASS::glm.nb(art ~ 1, data = bioChemists)

model_list <- lapply(list(fm_zip, fm_zip2,
                          glm_model, fm_zip3,
                          fm_zip5), tablelight::strip)

cat(
  tablelight::light_table(object = model_list,
                        covariate.labels = c("x1","x2")),
  sep = "\n"
)

## End(Not run)

linogaliana/tablelight documentation built on Jan. 29, 2021, 10:30 a.m.