Learn R Programming

tldr (version 0.3.0)

inline_test: 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)

Value

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

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

Examples

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

Run the code above in your browser using DataLab