Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pie Chart in R.

Similar presentations


Presentation on theme: "Pie Chart in R."— Presentation transcript:

1 Pie Chart in R

2 Enter the data vectors. This data is the percentages by weight of elements in the human body
symbols = c("O", "C", "H", "N", "Ca", "P", "K", "S", "Na", "Cl", "Mg") names = c("Oxygen", "Carbon", "Hydrogen", "Nitrogen", "Calcium", "Phosphorus", "Potassium", "Sulfur", "Sodium", "Chlorine", "Magnesium") number = c(8, 6, 1, 7, 20, 15, 19, 16, 11, 17, 12) percents = c(65, 18.5, 9.5, 3.3, 1.5, 1.0, 0.4, 0.3, 0.2, 0.2, 0.1)

3 Make a pie chart

4 Try a legend instead

5 Not sure students will be able to do this, but let’s try: Click on Packages, then Install

6 Type in plotrix and click Install

7 Now shows up in list

8 3D pie chart fro plotrix

9 With legend

10 Ggplot2 Ggplot2 is a very extensive library for R
After we see how installing the simpler plotrix library goes, we may use ggplot2


Download ppt "Pie Chart in R."

Similar presentations


Ads by Google