Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. library(tidyverse)
  2. # calculate the standard deviation for the two fields
  3. sd_N <- sd(data$N)
  4. sd_C <- sd(data$C)
  5.  
  6. # This will get us the plot for field `N`
  7. data %>%
  8. group_by(Year) %>%
  9. summarise(mean_N = mean(N)) %>%
  10. ggplot(aes(x = Year, y = mean_N)) +
  11. geom_point() +
  12. geom_line() +
  13. geom_errorbar(aes(ymin = mean_N - sd_N, ymax = mean_N + sd_N))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement