printTable: printTable

View source: R/utils.R

printTableR Documentation

printTable

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

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

# Example 1:
library(ez)
# 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 Sept. 9, 2022, 5:08 p.m.