Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. library (ggplot2)
  2.  
  3. 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 =
  4. c(
  5. 0.1,1.0,0.5,0.7
  6. ,0.13,0.33,0.54,0.76
  7. ,0.1,0.35,0.54,0.73
  8. ,1.3,1.5,1.75,1.7
  9. ,1.3,1.3,1.0,1.6
  10. ,1.7,1.6,1.75,1.7
  11. ,2.1,2.3,2.5,2.7
  12. ,2.5,2.6,2.6,2.8
  13. ,2.3,2.5,2.8,3.8),
  14. series_id = c(
  15. "A1", "A1", "A1","A1",
  16. "A1", "A1", "A1","A1",
  17. "A1", "A1", "A1","A1",
  18. "B1", "B1","B1", "B1",
  19. "B1", "B1","B1", "B1",
  20. "B1", "B1","B1", "B1",
  21. "C1","C1", "C1", "C1",
  22. "C1","C1", "C1", "C1",
  23. "C1","C1", "C1", "C1"),
  24. replicate = c(
  25. "A1.1","A1.1","A1.1","A1.1",
  26. "A1.2","A1.2","A1.2","A1.2",
  27. "A1.3","A1.3","A1.3","A1.3",
  28. "B1.1","B1.1","B1.1","B1.1",
  29. "B1.2","B1.2","B1.2","B1.2",
  30. "B1.3","B1.3","B1.3","B1.3",
  31. "C1.1","C1.1","C1.1","C1.1",
  32. "C1.2","C1.2","C1.2","C1.2",
  33. "C1.3","C1.3","C1.3","C1.3"))
  34.  
  35. > data
  36. day od series_id replicate
  37. 1 1 0.10 A1 A1.1
  38. 2 3 1.00 A1 A1.1
  39. 3 5 0.50 A1 A1.1
  40. 4 7 0.70 A1 A1.1
  41. 5 1 0.13 A1 A1.2
  42. 6 3 0.33 A1 A1.2
  43. 7 5 0.54 A1 A1.2
  44. 8 7 0.76 A1 A1.2
  45. 9 1 0.10 A1 A1.3
  46. 10 3 0.35 A1 A1.3
  47. 11 5 0.54 A1 A1.3
  48. 12 7 0.73 A1 A1.3
  49. 13 1 1.30 B1 B1.1
  50. ... etc...
  51.  
  52. r <- ggplot(data = data, aes(x = day, y = od))
  53. r + geom_point(aes(group = replicate, color = series_id)) + # add points
  54. geom_line(aes(group = replicate, color = series_id)) + # add lines
  55. geom_smooth(aes(group = series_id)) # add smoother, average of each replicate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement