I want to use the results of a k-s test with an inline code using RMarkdown. I can get ks$statistic[[1]] and ks$p.value[[1]] but when I use them inline, I get an error.
---
title: "ks test2"
output:
word_document: default
---
```{r setup, include=FALSE}
library(knitr)
knitr::opts_chunk$set(echo = TRUE, results="asis")
x <- rnorm(50)
ks <- ks.test(x, "pnorm", mean=mean(x),
sd=sd(x))
df <- length(x)
Based on K-S test (r D (df) = ks$statistic[[1]], p = ks$p.value[[1]]), we can conlude something.