knitr::opts_chunk$set(echo = TRUE)

doves_PA <- read.csv("~/1_R/git/wildlifeR_home/dove_prep/doves_PA.csv")

dim(doves_PA)
names(doves_PA)[1] <- "Year"
names(doves_PA)[2] <- "State"
names(doves_PA)[3] <- "Route"

there are errors in the county names - names chnage over time

doves_PA2 <- dcast(data = doves_PA,
                  formula = Year + State + Route ~ .,
                  value.var = "tot.seen",
                  fun.aggregate = sum)

names(doves_PA2)[4] <- "tot.seen"

dim(doves_PA)
dim(doves_PA2)

doves_PA <- doves_PA2
save(doves_PA, file = "./data/doves_PA.RData")
with(doves_PA,
     table(Route, county))


brouwern/compbio4all documentation built on Dec. 19, 2021, 11:47 a.m.