English · PDF 450
这两份速查表也可以在 < 获取http://rstudio.com/cheatsheets>.
你需要 rmarkdown 包,但无需显式安装或加载它,因为 RStudio 会在需要时自动完成这两项操作。
这是一个 R Markdown 文件,一种扩展名为 .Rmd 的纯文本文件:
-- title: "Diamond sizes" date: 2016-08-25 output: html_document --- {r setup, include = FALSE} library(ggplot2) library(dplyr) smaller <- diamonds %>% filter(carat <= 2.5) We have data about r nrow(diamonds) diamonds. Only r nrow(diamonds) - nrow(smaller) are larger than 2.5 carats. The distribution of the remainder is shown below: {r, echo = FALSE} smaller %>% ggplot(aes(carat)) + geom\_freqpoly(binwidth = 0.01)
它包含三种重要的内容类型: