First Lay Date data is important for investigating changes in nesting phenology over time. These data in the NestWatch dataset are provided by
participants, and the input of these dates may be overlooked by participants. If not explicitly provided by the participant, first lay date may be estimated
based off Hatch Date, Fledge Date, or if the nest was visited while eggs were still being laid. This function checks, in order, if the nest was visited
during egg laying, has a hatch date, or has a fledge date. If so, it uses user-input nest phenology timeframes to estimate the first lay date. Estimated
dates are denoted with a 1
in data$First.Lay.Date.Estimated
.
Arguments
- data
dataframe; A dataframe containing merged NestWatch attempts and visits data.
- phenology
dataframe; A dataframe one row of phenological data for each species to be estimated. Data columns as follows:
Species
: Species Codes for each species to be estimated.Clutch.Size
: Average clutch size for each species.Eggs.per.Day
: Average number of eggs laid per day by each species.Incubation
: Average number of days spent in incubation (days between clutch complete and hatch).Nestling
: Average number of days spent in nestling period (days between hatch and fledge).
- output
character; An optional character string to custom name the output dataframe
Details
Precision of the first lay date estimates depend on what data is used to estimate the values from. The function estimates based off of egg counts observed during lay first, followed by hatch date, and then fledge date. First lay dates are more likely to have high precision is based on known egg dates, as there is less variability in eggs laid per day than number of incubation days or number of days until fledge (which can both vary by individual, latitude, climate, and other factors).
Examples
# Simplified NestWatch dataset with missing data
# All hatch dates should be estimated to be 2024-05-01
data <- data.frame(Attempt.ID = c(1, 2, 3, 3),
Species.Code = rep("carwre", 4),
Visited.During.Egg.Laying = c(0, 0, NA, NA),
First.Lay.Date = as.Date(rep(NA, 4)),
Hatch.Date = as.Date(c("2024-05-20", NA, NA, NA)),
Fledge.Date = as.Date(c(NA, "2024-06-02", NA, NA)),
Clutch.Size = c(4, 4, NA, NA),
Visit.Datetime = as.Date(c("2024-05-19", "2024-06-01", "2024-05-02", "2024-05-15")),
Host.Eggs.Count = c(0, 0, 2, 4))
# Create phenology dataframe
phen <- data.frame(Species = c("carwre"),
Clutch.Size = c(4),
Eggs.per.Day = c(1),
Incubation = c(16),
Nestling = c(13))
# Run function
nw.estfirstlay(data = data, phenology = phen, output = "estimated.lay")
all(estimated.lay$First.Lay.Date == "2024-05-01")
#> [1] TRUE