SwissMarbledWhite {AHMbook}R Documentation

Data for Swiss Marbled White butterflies


Detection/nondetection data for the Marbled White butterfly (Melanargia galathea) collected in the canton of Aargau, Switzerland, as part of the Aargau Biodiversity Monitoring Program (LANAG). 519 study plots were each sampled once every five years from 1998 to 2010 with 11 visits each year, resulting in 1337 observed detection histories.




A data frame with 1337 rows and the following columns:


identification number for site


the year of the record

Day1, Day2, Day3, Day4, Day5, Day6, Day7, Day8, Day9, Day10, Day11

Julian date of the survey, 1 = 1st April. NA indicates that the date of the survey was not recorded; see Examples for a way to impute dates.

y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11

1 if the species was recorded during the survey, 0 otherwise.


Biodiversity Monitoring Program in the canton of Aargau, Switzerland (Courtesy Isabelle Flöss, Abteilung Landschaft und Gewässer des Kanton Aargau). See Appendix C of Roth et al. (2014).


Roth, T., Strebel, N. and Amrhein, V. (2014), Estimating unbiased phenological trends by adapting site-occupancy models. Ecology, 95: 2144-2154

Kéry, M. & Royle, J.A. (2021) Applied Hierarchical Modeling in Ecology AHM2 - 4.13.

See Also




# Data preparation for AHM2 section 4.13
y <- as.matrix(SwissMarbledWhite[,14:24])    # Grab detection/nondetection data
DATE <- as.matrix(SwissMarbledWhite[,3:13])  # Grab survey dates
for(t in 1:11) {               # Mean-impute date (but don't transform)
  DATE[[,t]),t] <- mean(DATE[,t], na.rm=TRUE)
year <- SwissMarbledWhite$year
nsites <- length(unique(SwissMarbledWhite$site))
nyears <- length(unique(SwissMarbledWhite$year))
nsurveys <- ncol(y)
nobs <- nrow(y)

[Package AHMbook version 0.2.3 Index]