I am using RStudio 1.0.44 and I when I run a code chunk in an RMarkdown document, the ouptut looks great but when knit to html or pdf it looks like plain old R console output.
Why the difference?
Example:
library(datasets)
library(dplyr)
data <- ToothGrowth
data %>%
group_by(supp, dose) %>%
summarise(n=(), mean=mean(len), sd=sd(len))
R Markdown:
```{r}
library(datasets)
library(dplyr)
data <- ToothGrowth
data %>%
group_by(supp, dose) %>%
summarise(n=n(), mean=mean(len), sd=sd(len))
```
knitr::kable()
to format dataframes – Richard Telford