Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library (ggplot2)
- data = data.frame (day = c(1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7,1,3,5,7), od =
- c(
- 0.1,1.0,0.5,0.7
- ,0.13,0.33,0.54,0.76
- ,0.1,0.35,0.54,0.73
- ,1.3,1.5,1.75,1.7
- ,1.3,1.3,1.0,1.6
- ,1.7,1.6,1.75,1.7
- ,2.1,2.3,2.5,2.7
- ,2.5,2.6,2.6,2.8
- ,2.3,2.5,2.8,3.8),
- series_id = c(
- "A1", "A1", "A1","A1",
- "A1", "A1", "A1","A1",
- "A1", "A1", "A1","A1",
- "B1", "B1","B1", "B1",
- "B1", "B1","B1", "B1",
- "B1", "B1","B1", "B1",
- "C1","C1", "C1", "C1",
- "C1","C1", "C1", "C1",
- "C1","C1", "C1", "C1"),
- replicate = c(
- "A1.1","A1.1","A1.1","A1.1",
- "A1.2","A1.2","A1.2","A1.2",
- "A1.3","A1.3","A1.3","A1.3",
- "B1.1","B1.1","B1.1","B1.1",
- "B1.2","B1.2","B1.2","B1.2",
- "B1.3","B1.3","B1.3","B1.3",
- "C1.1","C1.1","C1.1","C1.1",
- "C1.2","C1.2","C1.2","C1.2",
- "C1.3","C1.3","C1.3","C1.3"))
- > data
- day od series_id replicate
- 1 1 0.10 A1 A1.1
- 2 3 1.00 A1 A1.1
- 3 5 0.50 A1 A1.1
- 4 7 0.70 A1 A1.1
- 5 1 0.13 A1 A1.2
- 6 3 0.33 A1 A1.2
- 7 5 0.54 A1 A1.2
- 8 7 0.76 A1 A1.2
- 9 1 0.10 A1 A1.3
- 10 3 0.35 A1 A1.3
- 11 5 0.54 A1 A1.3
- 12 7 0.73 A1 A1.3
- 13 1 1.30 B1 B1.1
- ... etc...
- r <- ggplot(data = data, aes(x = day, y = od))
- r + geom_point(aes(group = replicate, color = series_id)) + # add points
- geom_line(aes(group = replicate, color = series_id)) + # add lines
- geom_smooth(aes(group = series_id)) # add smoother, average of each replicate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement