Skip to content

Commit 574f9fa

Browse files
worked on pie and donut
1 parent 57a4f6f commit 574f9fa

File tree

1 file changed

+3
-0
lines changed
  • 3-Data-Visualization/R/11-visualization-proportions

1 file changed

+3
-0
lines changed

3-Data-Visualization/R/11-visualization-proportions/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ The output is:
5959
Take this data and convert the 'class' column to a category:
6060

6161
```r
62+
library(dplyr)
6263
grouped=mushrooms %>%
6364
group_by(class) %>%
6465
summarise(count=n())
@@ -96,6 +97,7 @@ A somewhat more visually interesting pie chart is a donut chart, which is a pie
9697
Take a look at the various habitats where mushrooms grow:
9798

9899
```r
100+
library(dplyr)
99101
habitat=mushrooms %>%
100102
group_by(habitat) %>%
101103
summarise(count=n())
@@ -116,6 +118,7 @@ The output is:
116118
Here, you are grouping your data by habitat. There are 7 listed, so use those as labels for your donut chart:
117119

118120
```r
121+
library(ggplot2)
119122
library(webr)
120123
PieDonut(habitat, aes(habitat, count=count))
121124
```

0 commit comments

Comments
 (0)