Reputation:
I would like to put my summary statistics into a table using the kable function, but I cannot because it comes up as an array.
```{r setup options, include = FALSE}
knitr::opts_chunk$set(fig.width = 8, fig.height = 5, echo = TRUE)
library(mosaic)
library(knitr)
```
```{r}
sum = summary(SwimRecords$time) # generic data set included with mosaic package
kable(sum) # I want this to be printed into a table
```
Any suggestions?
Upvotes: 0
Views: 69
Reputation: 2261
You can do so easily with the broom
package which is built to "tidy" these stats-related objects:
#install.packages(broom)
broom::tidy(sum)
Upvotes: 1