Exploration of pop dynamic patterns at The Portal Project. How do counts of rodents like Dipodomys species change through time.
In this document I will:
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.4.4
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.4.4
data<- read.csv("https://ndownloader.figshare.com/files/2292172")
head(data)
## record_id month day year plot_id species_id sex hindfoot_length weight
## 1 1 7 16 1977 2 NL M 32 NA
## 2 2 7 16 1977 3 NL M 33 NA
## 3 3 7 16 1977 2 DM F 37 NA
## 4 4 7 16 1977 7 DM M 36 NA
## 5 5 7 16 1977 3 DM M 35 NA
## 6 6 7 16 1977 1 PF M 14 NA
the data includes 49 species
Get time-series of counts for Dipodomys species.
time_series<- data %>%
group_by(species_id, year) %>%
summarize(count = n()) %>%
filter(species_id %in% c('DM', 'DO', 'DS')) %>%
na.omit()
## Warning: package 'bindrcpp' was built under R version 3.4.4
head(time_series)
## # A tibble: 6 x 3
## # Groups: species_id [1]
## species_id year count
## <fct> <int> <int>
## 1 DM 1977 264
## 2 DM 1978 389
## 3 DM 1979 209
## 4 DM 1980 493
## 5 DM 1981 559
## 6 DM 1982 609