Generate a Publication-Ready Table from an ERGM Object
Source:R/tabulergm_table.R
tabulergm_table.RdS3 generic that dispatches to methods for fitted ergm objects
or plain formula objects, calling the internal parsing
engine and returning a formatted table.
Usage
tabulergm_table(object, ...)
# S3 method for class 'ergm'
tabulergm_table(
object,
include_description = FALSE,
include_math = FALSE,
include_attribute = FALSE,
format = c("data.frame", "html", "markdown"),
...
)
# S3 method for class 'formula'
tabulergm_table(object, format = c("data.frame", "html", "markdown"), ...)Arguments
- object
- ...
Additional arguments passed to methods.
- include_description
Logical. Include the term description column? Default
FALSE.- include_math
Logical. Include the mathematical notation column? Default
FALSE.- include_attribute
Logical. Include the attribute column? Default
FALSE.- format
Character. Output format:
"data.frame"(default),"html", or"markdown". HTML and Markdown output require the knitr package.
Methods (by class)
tabulergm_table(ergm): Method for fitted ergm objects.Calls
parse_ergm_modeland returns a table with default columnsterm,figure,estimate,se, andpvalue. Optional columns (description,math,attribute) can be included via logical arguments.tabulergm_table(formula): Method for formula objects.Calls
parse_ergm_formulaand returns a table with columnsterm,figure,math, anddescription. Coefficient statistics are excluded because no fitted model is available.
Examples
if (FALSE) { # \dontrun{
library(ergm)
data(florentine)
fit <- ergm(flomarriage ~ edges + nodematch("wealth"))
tabulergm_table(fit)
tabulergm_table(fit, include_description = TRUE)
tabulergm_table(fit, format = "markdown")
} # }
if (FALSE) { # \dontrun{
library(ergm)
tabulergm_table(network ~ edges + nodematch("gender"))
} # }