-
Notifications
You must be signed in to change notification settings - Fork 0
Plotting Basics
Meghan Balk edited this page Mar 29, 2018
·
16 revisions
x <- c(1, 3, 1, 2, 5, 1)
y <- c(1:10)
plot(x)
plot(x, type = “o”, col = “green”)
title(main = “Random Data”, col.main = “blue”, font.main = 4)
lines(y, type = “o”, col = “red”)
Exercise:
- Make the points triangles rather than circles.
- Make the lines dashed.
- Add a legend.
data(iris)
pairs(iris)
What is the output of this function?
Exercise:
- What is the distribution of petal lengths? (hint: make a histogram)
- What is the spread of petal lengths per species? (hint: use a box plot)
Day 1 or 2
- Basics of R
- Variables and objects
- Functions and packages
- Conditionals and logical operators
- Practice
- Recap
Day 3
Day 4
Day 5
Extra