Description Usage Arguments Details Examples
write_stats
converts a tidy stats results list to a data frame and then saves the data to a .csv file.
1 | write_stats(results, path)
|
results |
A tidy stats list. |
path |
Path or connection to write to. |
The prettyNum
function is used to format the numbers before saving them to disk. This is to prevent saving numbers with many decimals.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(dplyr)
# Create an empty list to store the results in
results <- list()
# Conduct statistical tests
model1 <- t.test(anxiety ~ condition, data = cox)
model2 <- cor.test(cox$anxiety, cox$avoidance)
# Add output to the results list
results <- results %>%
add_stats(model1, identifier = "M1") %>%
add_stats(model2, identifier = "M2")
# Save the results
dir <- tempdir()
write_stats(results, file.path(dir, "results.txt"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.