Description Usage Arguments See Also Examples
Adds htest objects to existing plots.
1 2 3 |
x |
an object of class |
legend_pos |
a position of the text on the plot. Either matrix or a single keyword.
See Details section of |
digits |
number of digits. |
bty |
the type of box to be drawn around the plotted test. The allowed values are "o" (border around plotted test information) and "n" (no border; the default). |
n_char |
|
... |
additional arguments sent to |
extend |
a non-negative integer specifying the indentation of subsequent lines in paragraphs. |
undocumented stats:::print.htest function - printing test summary.
legend
- responsible for adding test summary to plots.
strwrap
- splits longer lines on whitespaces.
1 2 3 4 5 6 7 8 9 10 11 12 | #Example 1: test for correlation between paired samples
x <- 1:20
y <- exp(x)
sample_cortest <- cor.test(x, y)
plot(x, y, type = "b")
plot(sample_cortest, "topleft")
#Example 2: Pearson's Chi-squared Test for Count Data
x <- matrix(c(12, 5, 7, 7), ncol = 2)
sample_chisqtest <- chisq.test(x, y)
barplot(x, beside = TRUE)
plot(sample_chisqtest, "topright")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.