Most of the times the results of a statistical test are a list
. I know that I only can use kable
with a data frame. The following example is a Kolmogorov-Smirnov
test (ks.test). There are also many at the psych
library. I want to have a nicer output knitting to Word
. How can this be done with a list like a
?
---
title: "ks test"
output:
word_document: default
---
```{r setup, include=FALSE}
library(knitr)
knitr::opts_chunk$set(echo = TRUE, results="asis")
```
```{r}
x <- rnorm(50)
y <- runif(30)
# Do x and y come from the same distribution?
a <- ks.test(x, y)
a
```
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.