printTable: printTable

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Returns Latex formatted table from dataframe or ezANOVA ANOVA table. Uses xtable latex package with some basic defaults. For more examples, see R package xtable

Usage

1
printTable(obj, caption = "DF", digits = 3, onlyContents = FALSE)

Arguments

obj

Dataframe/ezANOVA object to print

caption

Title of the dataframe

digits

Number of digits to round to NB. length can be 1, or vector with length equal to the number of numeric columns

onlyContents

TRUE/FALSE

Value

character

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
requiredPackages(c("dplyr", "ez"))

# Example 1:
# create dataframe
dat <- createDF(nVP = 6, nTrl = 1,
                design = list("Comp" = c("comp", "incomp", "neutral")))

dat <- addDataDF(dat, RT = list("Comp comp"    = c(500, 150, 100),
                                "Comp incomp"  = c(520, 150, 100),
                                "Comp neutral" = c(510, 150, 100)))
printTable(dat, digits = c(0, 2)) # latex formatted
printTable(dat, digits = 0)       # latex formatted

dat$VP <- as.factor(dat$VP)
aovRT <- ezANOVA(dat, dv=.(RT), wid = .(VP), within = .(Comp),
                 return_aov = TRUE, detailed = TRUE)
aovRT <- aovTable(aovRT)
printTable(aovRT$ANOVA) # latex formatted
printTable(aovRT$ANOVA, digits = c(0,2,2,2)) # latex formatted

psychReport documentation built on May 6, 2021, 5:05 p.m.