| 1 |
\name{mtable_format_html} |
| 2 |
\alias{mtable_format_html} |
| 3 |
\alias{format_html.memisc_mtable} |
| 4 |
\alias{mtable_format_html} |
| 5 |
\alias{mtable_format_stdstyle} |
| 6 |
\title{HTML Formatting for 'mtable' Results} |
| 7 |
\description{ |
| 8 |
These functions formats 'mtable' objects into HTML format. |
| 9 |
} |
| 10 |
\usage{ |
| 11 |
mtable_format_html(x, |
| 12 |
interaction.sep = NULL, |
| 13 |
toprule=2,midrule=1,bottomrule=2, |
| 14 |
split.dec=TRUE, |
| 15 |
style=mtable_format_stdstyle, |
| 16 |
margin="2ex auto", |
| 17 |
sig.notes.style=c(width="inherit"), |
| 18 |
\dots |
| 19 |
) |
| 20 |
\method{format_html}{memisc_mtable}(x, |
| 21 |
interaction.sep = NULL, |
| 22 |
toprule=2,midrule=1,bottomrule=2, |
| 23 |
split.dec=TRUE, |
| 24 |
style=mtable_format_stdstyle, |
| 25 |
margin="2ex auto", |
| 26 |
sig.notes.style=c(width="inherit"), |
| 27 |
\dots |
| 28 |
) |
| 29 |
} |
| 30 |
\arguments{ |
| 31 |
\item{x}{an object of class \code{mtable}} |
| 32 |
\item{toprule}{integer; |
| 33 |
thickness in pixels of rule at the top of the table.} |
| 34 |
\item{midrule}{integer; |
| 35 |
thickness in pixels of rules within the table.} |
| 36 |
\item{bottomrule}{integer; |
| 37 |
thickness in pixels of rule at the bottom of the table.} |
| 38 |
\item{interaction.sep}{a character string that separates factors that are involved |
| 39 |
in an interaction effect or NULL. If NULL then a reasonable default is used |
| 40 |
(either a unicode character or an ampersand encoded HTML entity).} |
| 41 |
\item{split.dec}{logical; whether numbers should be centered |
| 42 |
at the decimal point by splitting the table cells.} |
| 43 |
\item{style}{string containing default the CSS styling.} |
| 44 |
\item{margin}{character string, determines the margin and thus |
| 45 |
the position of the HTML table.} |
| 46 |
\item{sig.notes.style}{a character vector with named elements, |
| 47 |
allows extra styling of the p-values notes at the bottom of |
| 48 |
the table.} |
| 49 |
\item{\dots}{further arguments, ignored. } |
| 50 |
} |
| 51 |
\value{ |
| 52 |
A character string with code suitable for inclusion into a HTML-file. |
| 53 |
} |
| 54 |
\examples{ |
| 55 |
lm0 <- lm(sr ~ pop15 + pop75, data = LifeCycleSavings) |
| 56 |
lm1 <- lm(sr ~ dpi + ddpi, data = LifeCycleSavings) |
| 57 |
lm2 <- lm(sr ~ pop15 + pop75 + dpi + ddpi, data = LifeCycleSavings) |
| 58 |
|
| 59 |
mtable123 <- mtable("Model 1"=lm0,"Model 2"=lm1,"Model 3"=lm2, |
| 60 |
summary.stats=c("sigma","R-squared","F","p","N")) |
| 61 |
|
| 62 |
(mtable123 <- relabel(mtable123, |
| 63 |
"(Intercept)" = "Constant", |
| 64 |
pop15 = "Percentage of population under 15", |
| 65 |
pop75 = "Percentage of population over 75", |
| 66 |
dpi = "Real per-capita disposable income", |
| 67 |
ddpi = "Growth rate of real per-capita disp. income" |
| 68 |
)) |
| 69 |
|
| 70 |
# Use HTML entity '−' for minus sign |
| 71 |
options(html.use.ampersand=TRUE) |
| 72 |
show_html(mtable123) |
| 73 |
show_html(mtable123[1:2], |
| 74 |
sig.notes.style=c(width="30ex")) |
| 75 |
|
| 76 |
# Use unicode for minus sign (default) |
| 77 |
options(html.use.ampersand=FALSE) |
| 78 |
show_html(mtable123) |
| 79 |
} |
| 80 |
|