File: mtable-format-html.Rd

package info (click to toggle)
r-cran-memisc 0.99.31.8.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,136 kB
  • sloc: ansic: 5,117; makefile: 2
file content (80 lines) | stat: -rw-r--r-- 3,087 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
\name{mtable_format_html}
\alias{mtable_format_html}
\alias{format_html.memisc_mtable}
\alias{mtable_format_html}
\alias{mtable_format_stdstyle}
\title{HTML Formatting for 'mtable' Results}
\description{
  These functions formats 'mtable' objects into HTML format.
  }
\usage{
mtable_format_html(x,
                    interaction.sep = NULL,
                    toprule=2,midrule=1,bottomrule=2,
                    split.dec=TRUE,
                    style=mtable_format_stdstyle,
                    margin="2ex auto", 
                    sig.notes.style=c(width="inherit"),
                    \dots
  )
\method{format_html}{memisc_mtable}(x,
                    interaction.sep = NULL,
                    toprule=2,midrule=1,bottomrule=2,
                    split.dec=TRUE,
                    style=mtable_format_stdstyle,
                    margin="2ex auto", 
                    sig.notes.style=c(width="inherit"),
                    \dots
  )
}
\arguments{
     \item{x}{an object of class \code{mtable}}
     \item{toprule}{integer;
     thickness in pixels of rule at the top of the table.}
     \item{midrule}{integer;
     thickness in pixels of rules within the table.}
     \item{bottomrule}{integer;
     thickness in pixels of rule at the bottom of the table.}
     \item{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).}
    \item{split.dec}{logical; whether numbers should be centered
    at the decimal point by splitting the table cells.}
    \item{style}{string containing default the CSS styling.}
    \item{margin}{character string, determines the margin and thus
      the position of the HTML table.}
    \item{sig.notes.style}{a character vector with named elements,
           allows extra styling of the p-values notes at the bottom of
           the table.}
    \item{\dots}{further arguments, ignored. }
}
\value{
    A character string with code suitable for inclusion into a HTML-file.
}
\examples{
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"
))

# Use HTML entity '&minus;' for minus sign
options(html.use.ampersand=TRUE)
show_html(mtable123)
show_html(mtable123[1:2],
          sig.notes.style=c(width="30ex"))

# Use unicode for minus sign (default)
options(html.use.ampersand=FALSE)
show_html(mtable123)
}