HTML Formatting for 'mtable' Results

Share:

Description

These functions formats 'mtable' objects into HTML format.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
mtable_format_html(x,
                    interaction.sep = NULL,
                    toprule=2,midrule=1,bottomrule=2,
                    split.dec=TRUE,
                    style=mtable_format_stdstyle,
                    margin="2ex auto", 
                    force.names=FALSE,
                    ...
  )
## S3 method for class 'mtable'
format_html(x,
                    interaction.sep = NULL,
                    toprule=2,midrule=1,bottomrule=2,
                    split.dec=TRUE,
                    style=mtable_format_stdstyle,
                    margin="2ex auto", 
                    force.names=FALSE,
                    ...
  )

Arguments

x

an object of class mtable

toprule

integer; thickness in pixels of rule at the top of the table.

midrule

integer; thickness in pixels of rules within the table.

bottomrule

integer; thickness in pixels of rule at the bottom of the table.

interaction.sep

a character string that separates factors that are involved in an interaction effect or NULL. If NULL then a reasonable default is used (either a unicode character or an ampersand encoded HTML entity).

split.dec

logical; whether numbers should be centered at the decimal point by splitting the table cells.

style

string containing default the CSS styling.

margin

character string, determines the margin and thus the position of the HTML table.

force.names

logical; should model names be shown even if estimates of only one model are displayed?

...

further arguments, ignored.

Value

A character string with code suitable for inclusion into a HTML-file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
lm0 <- lm(sr ~ pop15 + pop75,              data = LifeCycleSavings)
lm1 <- lm(sr ~                 dpi + ddpi, data = LifeCycleSavings)
lm2 <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings)

mtable123 <- mtable("Model 1"=lm0,"Model 2"=lm1,"Model 3"=lm2,
                    summary.stats=c("sigma","R-squared","F","p","N"))

(mtable123 <- relabel(mtable123,
                      "(Intercept)" = "Constant",
                      pop15 = "Percentage of population under 15",
                      pop75 = "Percentage of population over 75",
                      dpi = "Real per-capita disposable income",
                      ddpi = "Growth rate of real per-capita disp. income"
))

show_html(mtable123)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.