knitr::opts_chunk$set(echo = TRUE)
library(reshape2)
filename <- "site_persist_cleaned.csv" filename <- here::here("data-raw", "data-raw-mencia", "mencia_site_persistence", filename) sp <- read.csv(file = filename)
sp$site <- factor(sp$site, levels = c("La Cueva", "La Caoba", "Morelia", "El Corral"))
Identify first instance of bird occuring. (I checked - all birds have the same age code even if recaptured; recaps rare regardless)
i.unique <- match(unique(sp$band),sp$band) length(unique(sp$band)) length(i.unique) length(which(duplicated(sp$band) == TRUE))
age.cast <- dcast(data= sp[i.unique,], formula = species + status ~ site, value.var = "site", fun.aggregate = length) age.cast[which(age.cast$status == "mig"), ]
sex.cast <- dcast(data= sp[i.unique,], formula = species + status ~ site + sex, value.var = "site", fun.aggregate = length) sex.cast[which(sex.cast$status == "mig"), ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.