inline_test | R Documentation |
inline_test
formats the results of an htest object into LaTeX to be presented inline in an RMarkdown document.
inline_test(test, stat = TRUE, pval = TRUE, digits = 2)
inline_test_p(test, digits = 2)
test |
An htest object |
stat |
Logical, whether to report test statistic (default TRUE) |
pval |
Logical, whether to report p-value (default TRUE) |
digits |
Number of digits to round to (default to 2) |
This function currently only supports t tests and chi-squared tests. Suggestions and requests are welcomed.
inline_test_p
is a wrapper for inline_test
to report only the p-value (sets all non-p-value logicals to FALSE).
Returns a LaTeX-formatted hypothesis test result for use in RMarkdown document.
x = rnorm(20)
test1 = t.test(x)
inline_test(test1)
inline_test_p(test1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.