inline_test {tldr}R Documentation

Report a hypothesis test inline

Description

inline_test formats the results of an htest object into LaTeX to be presented inline in an RMarkdown document.

Usage

inline_test(test, stat = TRUE, pval = TRUE, digits = 2)

inline_test_p(test, digits = 2)

Arguments

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)

Details

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).

Value

Returns a LaTeX-formatted hypothesis test result for use in RMarkdown document.

Examples

x = rnorm(20)
test1 = t.test(x)
inline_test(test1)
inline_test_p(test1)


[Package tldr version 0.4.0 Index]