SHARE
TWEET

Untitled

a guest Jun 16th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top