Created
January 18, 2019 20:52
-
-
Save crsh/0ef3cb0f397cdd687d9392400c27a7dd to your computer and use it in GitHub Desktop.
Use variable labels to italicize column headers with apa_table()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_table <- data.frame(t(apply(cars, 2, function(x) # Create data | |
round(c(Mean = mean(x), SD = sd(x), Min = min(x), Max = max(x)), 2) | |
))) | |
variable_labels(my_table) <- c("Mean" = "$\\textit{Mean}$", "SD" = "$\\textit{SD}$") | |
apa_table( | |
my_table | |
, align = c("l", rep("r", 3)) | |
, caption = "A summary table of the cars dataset." | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment