forked from cb4ds/cxplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeom_histogram.Rmd
54 lines (36 loc) · 1.24 KB
/
geom_histogram.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: "Geom Histogram"
output: geom_histogram
---
https://ggplot2.tidyverse.org/reference/geom_histogram.html
```{r}
source('cxplot.r')
library(ggplot2)
library(dplyr)
library(canvasXpress)
```
```{r}
cxplot(ggplot(diamonds, aes(carat)) + geom_histogram())
```
```{r}
cxplot(ggplot(diamonds, aes(carat)) + geom_histogram(binwidth = 0.01))
```
```{r}
cxplot(ggplot(diamonds, aes(carat)) + geom_histogram(bins = 200))
```
```{r}
cxplot(ggplot(diamonds, aes(price, fill = cut)) + geom_histogram(binwidth = 500))
```
```{r}
cxplot(ggplot(diamonds, aes(price, colour = cut)) + geom_freqpoly(binwidth = 500))
```
```{r}
cxplot(ggplot(diamonds, aes(price, after_stat(density), colour = cut)) + geom_freqpoly(binwidth = 500))
```
```{r}
```
```{r}
```
Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Cmd+Option+I*.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Cmd+Shift+K* to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.