r4ds/rmarkdown/diamond-sizes.Rmd

25 lines
448 B
Plaintext
Raw Normal View History

2016-08-26 05:44:14 +08:00
---
title: "Diamond sizes"
date: 2016-08-25
output: html_document
---
```{r setup, include = FALSE}
library(ggplot2)
library(dplyr)
2022-02-24 03:15:52 +08:00
smaller <- diamonds |>
2016-08-26 05:44:14 +08:00
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
2016-08-26 05:44:14 +08:00
below:
```{r, echo = FALSE}
2022-02-24 03:15:52 +08:00
smaller |>
2016-08-26 05:44:14 +08:00
ggplot(aes(carat)) +
geom_freqpoly(binwidth = 0.01)
```