Packages and Data

setwd("C:/Users/Destiney/Downloads/Northland College/MTH/Graphs")
library("plyr")
library(tidyverse)
library("reshape2")
library(magrittr)
df1 <- read.csv2("Survival_database_RealShorebirdNests.csv")%>%
  mutate(sp=plyr::mapvalues(sp,from=c("amgp","crpl"),to=c("Golden Plover",
    "Ringed Plover")))%>%
  mutate(fate=plyr::mapvalues(fate,from=c(0,1),to=c("Failure","Success")))
str(df1)
head(df1)
df2 <- read.csv("Yearlyobservationindices.csv",fileEncoding = 'UTF-8-BOM')
str(df2)
head(df2)
RAI<- melt(df2,measure.vars=c("Lemming","Fox","Jaeger","Gull","Goose"),
      variable.name="Species")
str(RAI)
head(RAI)

Arctic Shorebird Nest Survival by Year and Species

This data comes from a study that was done in the Arctic Circle on Bylot Island in Sirmilik National Park, Canada. The purpose of the study was to collect data regarding the variables that affect shorebird nest Survival. They conducted two seperate surveys, one that used artifical nests and one that real nests. For my plot, I have choosen to use the real nesting data. This study focused on two shorebird species, the golden plover (Pluvialis dominica) and the ringed plover (Charadrius hiaticula) and each’s frequency of nest survival. I choose to used a bar chart, because I am comparing two different species and multiple years to compare the frequency of discrete data. I wanted to see if there was a difference between the survival of bothe species’ nests, and I also wanted to see if this has change over time. According to this plot, ot appears that the ringed plover has a higher ratio of frequency of nest survival when compared to the golden plover. However, there is a higher number of golden plover nest success overall.Th is remains constant for all three years in this study, and the frequency ratios seem to stay fairly constant as well. The number golden plover nests in general seem to be decreasing, but this may be due to the sampling method. This shows that year is not a variable that affects these numbers, but the limit number of years may contribute to this conclusion. While year may not seem like a valuable variable, because it doesn’t show change in this case, I think that it is important to include, as the lack of relationship still tells you something about the data. I choose to use this data, because I didn’t know much about arctic birds, so I thought that it would be something interesting to learn about.

graph1 <- ggplot(df1,mapping=aes(x=fate,fill=sp))
graph1+
  geom_bar(stat="count",color="gray50",na.rm=TRUE)+
  facet_grid(rows=vars(sp),cols=vars(year))+
  scale_y_continuous(name="Frequency of Shorebird Nests",
    expand=expansion(mult=c(0,0.05)))+
  scale_x_discrete(limits=c("Failure","Success"),name="Nesting Outcome")+
  labs(title="Frequency of Shorebird Nest Predation, 2014-2016",
    subtitle="Southwest Plain of Bylot Island, Nunavut, Canada",
    caption="Source:https://doi.org/10.5061/dryad.4xgxd254v")+
  scale_fill_manual(values=c("gray80","gray30"))+
  theme_bw()+
  theme(panel.grid.major.x=element_blank(),
        panel.grid.minor.y=element_blank(),
        panel.grid.major.y=element_line(linetype="dashed"))+
  theme(legend.position="none",
        plot.caption=element_text(margin=margin(5,0,5,0)),
        plot.title=element_text(face="bold",size=rel(1.4)),
        plot.subtitle=element_text(size=rel(1.1)),
        plot.background=element_rect(color="black"),
        axis.title.y=element_text(face="bold",size=12,margin=margin(0,20,0,20)),
        axis.title.x=element_text(face="bold",size=12,margin=margin(20,0,10,0)),
        panel.grid.minor=element_blank(),
        axis.text=element_text(face="bold",size=12))

Predator-Prey Interactions on the Arctic Mainland

This data comes from a study that was done in the Arctic Circle in Qausuittuq National Park, Canada. The purpose of the study was to collect data regarding the presence of species based upon their predator-prey interactions. The specific data I will be using in my graph is calculated on RAI(Relative Abundance Indices.), and this was already calculated in the provided data. The sightings were based upon data collected from camera traps and observations made throughout 8 hour long watching periods during the day between 2000 and 2016. However, data for the gulls and geese were not collected before 2004. The species being monitered were the arctic lemming (Dicrostonyx torquatus), a rodent similar to a gopher, the arctic fox (Vulpes lagopus), the parasitic jeager (Stercorarius parasiticus), a type of gull, and the ivory gull (Pagophila eburnea), a smaller whie gull. For the sake of presentation purposes to the class, I will include common names rather than their binomial nomenclature. While this graph correctly demonstrates the Sighting Index of each species, some modifications were made for viusal purposes. In the provided metadata, the author had specified that this data should have the following adjustments: Jaeger (RAI/1.5),Gull (RAI/4), and Goose (RAI/25). This allows the viewer to easily compare the indexes with each species with the knowledge of these adjustments. I choose to use a line graph to show this data, because it is measuring the effects of abundance on each species over time. I choose to include different linetypes and shapes for the points to make it easier to identify each species where there is a lot of overlap. I decided not to use color, because in a professional setting, it is more commonplace and less expensive. I choose this data, because I have an interest in the relationships between predator and prey populations, especially anything including foxes. This also compliments the other data set I used, which was based on birdnest predation variables. Some things that I thought were interesting were the different patterns that you can see by comparing the abundances of any two given species. For example, when you take a look at the fox and lemming data, you can see a slight ossilation happening as they both increase and decrease. This is suggestive of a prey and predator relationship, but there may be other factors that influence this as well.

graph2 <- ggplot(RAI,mapping=aes(x=Year,y=value,linetype=Species,shape=Species,
          color="black"))
graph2 +
  geom_point(size=3,color="black",fill="gray30",na.rm=TRUE) +
  geom_line(size=1,color="black",na.rm=TRUE) +
  scale_y_continuous(name="Sighting Index",
        expand=expansion(mult=c(0,0.1))) +
  scale_x_continuous(name="Year",breaks = seq(2000,2016,1),
        expand=expansion(mult=c(0.05,0.05))) +
  labs(title="Arctic Predator-Prey Interaction Model, 2000-2016",
        subtitle="Data Based on RAI collected off of the East Bay Mainland",
        caption="Source:https://doi.org/10.1371/journal.pone.0221727")+
  annotate(geom="label",x=2000,y=4.3,hjust="left",
        label="Gull and Goose data\nnot available before 2004")+
  annotate(geom="segment",x=2001.5,y=4.1,xend=2003.8,yend=2.6,size=0.25,color="black",
        arrow=arrow(length=unit(2.5,"mm"),angle=15,type="closed")) +
  scale_shape_manual(values=c(21,25,23,24,22))+
  theme_bw()+
  theme(panel.grid.major.x=element_blank(),
        panel.grid.minor.y=element_blank(),
        panel.grid.minor.x=element_blank())+
  theme_classic()+
  theme(axis.title.x=element_blank(),
        plot.caption=element_text(margin=margin(20,0,20,0)),
        plot.title=element_text(face="bold",size=rel(1.4)),
        plot.subtitle=element_text(size=rel(1.1)),
        plot.background=element_rect(color="black"),
        axis.title.y=element_text(face="bold",size=12,margin=margin(0,20,0,20)),
        panel.grid.minor=element_blank(),
        axis.text=element_text(face="bold",size=12))