table2html: table2html

Description Usage Arguments Details Value Examples

View source: R/table2html.R

Description

Creates an HTML view on a two dimensional table.

Usage

1
2
table2html(tab, colsums = NULL, rowsums = NULL, bg = c("white",
  "lightGray"), border = "grey", style = "width:95%;margin:10px;", ...)

Arguments

tab

table: table to show

colsums

character: If non-NULL the column sums will be computed and the contents of colsums appears as header (default: NULL)

rowsums

character: If non-NULL the rows sums will be computed and the contents of rowsums appears as header (default: NULL)

bg

colors: background color for table rows, will be recycled (default: c("white", "lightGray"))

border

color: background color for header cells (default: "grey")

style

character: style information for the table (default: "width:95%;margin:10px;")

...

further parameters used for the format command for formatting table entries

Details

In case of a non-numeric table colsums and rowsums is ignored.

Value

character: the HTML code for the table

Examples

1
2
3
4
5
tab <- HairEyeColor[,,'Female']
htmltab <- table2html(tab, colsums='', rowsums='')
sink('HairEye.html')
cat(htmltab)
sink()

sigbertklinke/mmstat documentation built on May 14, 2019, 8:36 a.m.