printTidy2way: Print multi-way tidytable information in console or two-way...

Description Usage Arguments Note Author(s) See Also Examples

Description

Print multi-way tidytable information in console or two-way tidytable information in latex format.

Usage

1
2
3
printTidy2way(tidytableInfo, display = c("console", "latex"),
  tableCaption = NULL, printUnit = TRUE, printLocation = TRUE,
  file = NULL, append = FALSE)

Arguments

tidytableInfo

A sample of data with dimensions >= 2, can be a matrix, an array or a table. If display choosen to be "latex", then dimension of the data must be = 2.

display

To show the table in console or laTex.

tableCaption

The caption of the table.

printUnit

Logical, Print the unit of the tidytable.

printLocation

Logical, Print the location of the tidytable.

file

If NULL, then the latex code will be shown in console. Otherwise, the code will be written to file (as in the latex command from the Hmisc package).

append

Logical, append latex output to an existing file.

Note

printTidy2way() could print tidy table for multi-way tables in R console, but it can only print tidy table for two-way tables in latex code due to the limit of Hmisc::latex() function we used.

Author(s)

R. Wayne Oldford and Xiaomei Yu

See Also

latex for print two dimensional table in latex format.

Examples

 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
table1<-c(97.62,92.24,100.90,90.39,48.29,42.31,49.98,39.09,75.23,75.16,100.11,74.23,49.69,57.21,80.19,51.09)
table1 <- matrix(table1, nrow=4,byrow=TRUE,dimnames=list(c("North" ,"South","East","West"),c("Q1","Q2","Q3","Q4")))
table1
printTidy2way(tidytable(table1), display="console", tableCaption="Sales data")
printTidy2way(tidytable(table1), display="latex", tableCaption="Sales data")


table2 <- c(.7999, .7998, .7998, .7997,
3.7999,3.7824,3.7662,3.7223,
0.3,1.2,4.9,145.7,
20.799,20.699,20.899,145.699,
35.3, 34.5,33.6,34.7)
table2 <- matrix(table2, ncol=4,byrow=TRUE,dimnames=list(c("A" ,"B","C","D","E"),c("1","2","3","4")))
printTidy2way(tidytable(table2), display="console")
printTidy2way(tidytable(table2), display="latex")


UCBAdmissions
printTidy2way(tidytable(UCBAdmissions),display="console")

HairEyeColor
printTidy2way(tidytable(HairEyeColor),display="console")


Titanic
printTidy2way(tidytable(Titanic),display="console")

rwoldford/tidy-table documentation built on May 12, 2019, 4:38 a.m.