## Warning: package 'bindrcpp' was built under R version 3.4.3

Forage Quality Comparison across Management Types

Shown for each: June, July, August, JJA combined, MJJAS combined (2018)

Which one(s) do we want to show?

Forage Comparison Over Time

I tried to filter out patch burn pastures (1st graph) then control pastures (2nd graph).

Then I ran it without filtering by plot (3rd graph) and it looks exactly the same as the patch burn graph.

Also the control graph needs help, how do I fix it so REF and WAG are separated and labelled as continuous and twice over?

overtimepb.gg <-
  cgrec.st %>%
  filter(grepl('BOB|BAR', plot))%>%
  ddply(., .(ysf, month, response), 
        summarise, 
        mean=round(mean(value), 1), 
        sem=round(sd(value)/sqrt(length(value)), 3) ) %>%
  mutate(ysf=revalue(ysf, 
                     c("0"="Burned\nthis year", 
                       "1"="Burned\nlast year",
                       "UB"="Not yet\nburned")),
         #response=revalue(response, 
         #c("protein"="Crude protein (%)", 
         #  "fecal"="Fresh cow pie density",
         # "kg.ha"="Available forage (kg/ha)")),
         month=factor(month, levels(month)[c(4,3,2,1,5)])) %>%
  
  ggplot(aes(x=month, y=mean, color=ysf))+
  geom_errorbar(aes(ymin=mean-sem, 
                    ymax=mean+sem),
                width=0.25, lwd=1.25,  
                position=position_dodge(width = 0.25)) +
  geom_line(aes(group=ysf), 
            position=position_dodge(width = 0.25), lwd=1.0)+
  
  geom_point(aes(fill=ysf, shape=ysf), color="black", stroke=1.5, position=position_dodge(width = 0.25), size=4)+
  labs(x="Month", y=" ")+
  scale_color_manual(name="", values = c("#56B4E9","#AA4371", "#E69F00"))+
  scale_fill_manual(name="", values = c("#56B4E9","#AA4371", "#E69F00"))+
  scale_shape_manual(name="", values = c(24,22,25))+
  theme_bw(18)+
  facet_wrap(~response, scales="free_y", ncol=1)+
  theme(legend.position = "top",
        legend.key.width = unit(12, "mm"),
        legend.text.align = 0.5,
        panel.grid.major.x=element_blank(), 
        panel.grid.minor = element_blank(),
        strip.text = element_text(face="bold"),
        axis.text.x = element_text(color="black"))

#png(filename = "./Graphs/overtime_pb.png", width = 14, height = 18, units = "cm", res = 400)
overtimepb.gg

#dev.off()

#control mgmt comparison - I tried to filter the control plots out, but how do I fix it so REF and WAG are separate as continuous and 2x over?

overtimecont.gg <-
  cgrec.st %>%
  filter(grepl('REF|WAG', plot))%>%
  ddply(., .(ysf, month, response), 
        summarise, 
        mean=round(mean(value), 1), 
        sem=round(sd(value)/sqrt(length(value)), 3) ) %>%
  mutate(ysf=revalue(ysf, 
                     c("0"="Burned\nthis year", 
                       "1"="Burned\nlast year",
                       "UB"="Not yet\nburned")),
         #response=revalue(response, 
         #c("protein"="Crude protein (%)", 
         #  "fecal"="Fresh cow pie density",
         # "kg.ha"="Available forage (kg/ha)")),
         month=factor(month, levels(month)[c(4,3,2,1,5)])) %>%
  
  ggplot(aes(x=month, y=mean, color=ysf))+
  geom_errorbar(aes(ymin=mean-sem, 
                    ymax=mean+sem),
                width=0.25, lwd=1.25,  
                position=position_dodge(width = 0.25)) +
  geom_line(aes(group=ysf), 
            position=position_dodge(width = 0.25), lwd=1.0)+
  
  geom_point(aes(fill=ysf, shape=ysf), color="black", stroke=1.5, position=position_dodge(width = 0.25), size=4)+
  labs(x="Month", y=" ")+
  scale_color_manual(name="", values = c("#56B4E9","#AA4371", "#E69F00"))+
  scale_fill_manual(name="", values = c("#56B4E9","#AA4371", "#E69F00"))+
  scale_shape_manual(name="", values = c(24,22,25))+
  theme_bw(18)+
  facet_wrap(~response, scales="free_y", ncol=1)+
  theme(legend.position = "top",
        legend.key.width = unit(12, "mm"),
        legend.text.align = 0.5,
        panel.grid.major.x=element_blank(), 
        panel.grid.minor = element_blank(),
        strip.text = element_text(face="bold"),
        axis.text.x = element_text(color="black"))

#png(filename = "./Graphs/overtime_cont.png", width = 14, height = 18, units = "cm", res = 400)
overtimecont.gg

#dev.off()

# didn't filter by plot in this one - why does it look exactly the same as overtimepb.gg?

overtimeall.gg <-
  cgrec.st %>%
  ddply(., .(ysf, month, response), 
        summarise, 
        mean=round(mean(value), 1), 
        sem=round(sd(value)/sqrt(length(value)), 3) ) %>%
  mutate(ysf=revalue(ysf, 
                     c("0"="Burned\nthis year", 
                       "1"="Burned\nlast year",
                       "UB"="Not yet\nburned")),
         #response=revalue(response, 
         #c("protein"="Crude protein (%)", 
         #  "fecal"="Fresh cow pie density",
         # "kg.ha"="Available forage (kg/ha)")),
         month=factor(month, levels(month)[c(4,3,2,1,5)])) %>%
  
  ggplot(aes(x=month, y=mean, color=ysf))+
  geom_errorbar(aes(ymin=mean-sem, 
                    ymax=mean+sem),
                width=0.25, lwd=1.25,  
                position=position_dodge(width = 0.25)) +
  geom_line(aes(group=ysf), 
            position=position_dodge(width = 0.25), lwd=1.0)+
  
  geom_point(aes(fill=ysf, shape=ysf), color="black", stroke=1.5, position=position_dodge(width = 0.25), size=4)+
  labs(x="Month", y=" ")+
  scale_color_manual(name="", values = c("#56B4E9","#AA4371", "#E69F00"))+
  scale_fill_manual(name="", values = c("#56B4E9","#AA4371", "#E69F00"))+
  scale_shape_manual(name="", values = c(24,22,25))+
  theme_bw(18)+
  facet_wrap(~response, scales="free_y", ncol=1)+
  theme(legend.position = "top",
        legend.key.width = unit(12, "mm"),
        legend.text.align = 0.5,
        panel.grid.major.x=element_blank(), 
        panel.grid.minor = element_blank(),
        strip.text = element_text(face="bold"),
        axis.text.x = element_text(color="black"))

#png(filename = "./Graphs/overtime_all.png", width = 14, height = 18, units = "cm", res = 400)
overtimeall.gg

#dev.off()