TIRC: HTML Table With Some Extras generic function to print html...

Usage Arguments Examples

View source: R/TIRC.R

Usage

 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
TIRC(x, ...)

## Default S3 method:
TIRC(x, title = "", header, align = paste(rep("l",
  ncol(x)), collapse = ""), halign = paste(rep("l", ncol(x)), collapse = ""),
  cgroup, n.cgroup, cgroup.just, rgroup, n.rgroup,
  rgroupCSSstyle = "font-weight: bold", rgroupCSSseparator = "", tspanner,
  n.tspanner,
  tspannerCSSstyle = "font-weight: 900; text-transform:capitalize; text-align: center;",
  tspannerCSSseparator = "border-top: 1px solid grey;", rowlabel = title,
  rowlabel.pos = "bottom", headLines = "single",
  compatibility = "LibreOffice", rnames, caption, caption.loc = "top",
  tfoot, label, zebra = F, highrows, TURK = F, rgroup_col, ...)

## S3 method for class 'table'
TIRC(x, title = "", header, align = paste(rep("l", ncol(x)),
  collapse = ""), halign = paste(rep("l", ncol(x)), collapse = ""), cgroup,
  n.cgroup, cgroup.just, rgroup, n.rgroup,
  rgroupCSSstyle = "font-weight: bold", rgroupCSSseparator = "", tspanner,
  n.tspanner,
  tspannerCSSstyle = "font-weight: 900; text-transform:capitalize; text-align: center;",
  tspannerCSSseparator = "border-top: 1px solid grey;", rowlabel = title,
  rowlabel.pos = "bottom", headLines = "single",
  compatibility = "LibreOffice", rnames, caption, caption.loc = "top",
  tfoot, label, zebra = F, highrows, TURK = F, ...)

## S3 method for class 'TIRC'
print(x, useViewer, ...)

Arguments

x

Matrix, data.frame, or table with the data

title

String containing title for table

align

defines the vertical alignment within cells (default All left alligned)

halign

defines the horizontal alignment within cells (default All lower aligned)

cgroup

defines the groupings for columns

n.cgroup

defines the number of columns each cgroup should span. Must sum to total number of columns

cgroup.just

defines horizontal alignment in cell for cgroup

rgroup

defines the groupings for rows.

n.rgroup

defines the number of rows each rgroup should span.

rgroupCSSstyle

adds css to rgroup

rgroupCSSseparator

css separator for rgroups

tspanner

table spanner

n.tspanner

counts for each table spanner

tspannerCSSseparator

css to be added between table spanners

rowlabel

string to be placed above rownames

rowlabel.pos

defines the position of the row label

headLines

defines how many horizontal lines start the table

compatibility

some html tweaks for different systems

rnames

defines row names. If a single string is given and it matches a column name then that column is used.

caption

string used as caption

tfoot

string used as footer for table

label

adds a css id to table

zebra

highlights alternate rows if TRUE (default FALSE)

highrows

logical indicating rows to highlight or string indicating column containing highlight column

rgroup_col

name of column to use instead of rgroup and n.rgroup

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
tab_data <- data.frame(rgrp=c("Early", "Early", "Late"),
                       rnms = c("A", "B", "C"), 
                       Red=c("10 (40%)", "10 (40%)", "5 (20%)"), 
                       Green=c("20 (50%)", "16 (40%)", "4 (10%)"))

TIRC(tab_data, rnames=F)
TIRC(tab_data, rnames="rnms")
TIRC(tab_data, rnames="rnms", rgroup_col = "rgrp")

tab_data2 <- data.frame(col=sample(c("Red", "Green"), 100, replace=T), 
                        shape=sample(c("Round", "Square"), 100, replace=T))

tab <- with(tab_data2, table(col, shape))
TIRC(tab)

jachan1/repFxns documentation built on July 20, 2021, 10:51 p.m.