Single Season Occupancy Model

The simplest model using the ubms package

Fits the single season occupancy model of MacKenzie et al (2002).
R
occupancy
ubms
Author
Affiliation

Diego J. Lizcano

WildMon

Published

July 17, 2024

Load packages

First we load some packages

Code

library(grateful) # Facilitate Citation of R Packages
library(patchwork) # The Composer of Plots
library(readxl) # Read Excel Files
library(sf) # Simple Features for R
library(mapview) # Interactive Viewing of Spatial Data in R
library(terra) # Spatial Data Analysis
library(elevatr) # Access Elevation Data from Various APIs
library(readr)

library(camtrapR) # Camera Trap Data Management and Preparation of Occupancy and Spatial Capture-Recapture Analyses 
library(unmarked) 
library(ubms) 
library(DT)

library(kableExtra) # Construct Complex Table with 'kable' and Pipe Syntax
library(tidyverse) # Easily Install and Load the 'Tidyverse'

# source("C:/CodigoR/CameraTrapCesar/R/organiza_datos.R")

Organize the data

The workflow starts with package unmarked and continue with the package ubms for model building, selection and prediction. The first step to perform the analysis is to organize data following the unmarked package. The data should have detection, non-detection records along with the covariates.

See the unmarkedFrameOccu function for details typing: ?unmarkedFrameOccu in your R console.

Load data

The data set was collected by Sebastián Mejía-Correa and is part of the study: Mejia-Correa S, Diaz-Martinez A. 2014. Densidad y hábitos alimentarios de la danta Tapirus bairdii en el Parque Nacional Natural Los Katios, Colombia. Tapir Conservation. 23:16–23..

Code


katios1 <- read_excel("C:/CodigoR/CameraTrapCesar/data/katios/Tbairdii_sebastian.xlsx", sheet = "danta")

View the data

Code
datatable(head(katios1))

View as map

Code

projlatlon <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

katios_sf <-  st_as_sf(x = katios1 |> distinct(Longitude, Latitude, camera),
                         coords = c("Longitude", 
                                    "Latitude"),
                         crs = projlatlon)

mapview(katios_sf)#, zcol="species")

Function to make detection history matrix

Code


f.matrix.creator<-function(data){
  #results object
  res<-list()
  
  #get the dimensions of the matrix
  
  #list if sanpling units
  cams<-unique(data$camera)
  cams<-sort(cams)
  rows<-length(cams)
  species<-unique(data$species)
  #start and end dates of sampling periods
  # data<-data[data$Sampling.Period==year,]
  min<-min(as.Date(as.character(data$start), "%Y-%m-%d"))
  max<-max(as.Date(as.character(data$end), "%Y-%m-%d"))
  cols<-max-min+1
  
  #sampling period
  date.header<-seq(from=min,to=max, by="days")
  mat<-matrix(NA,rows,cols,dimnames=list(cams,as.character(date.header)))
  
  #for all cameras, determine the open and close date and mark in the matrix
  start.dates<-tapply(as.character(data$start),data$camera,unique)
  nms<-names(start.dates)
  # start.dates<-ymd(start.dates)
  names(start.dates)<-nms
  end.dates<-tapply(as.character(data$end),data$camera,unique)
  # end.dates<-ymd(end.dates)
  names(end.dates)<-nms
  
  #outline the sampling periods for each camera j
  for(j in 1:length(start.dates)){
    #for each camera beginning and end of sampling
    low<-which(date.header==as.Date(as.character(start.dates[j]), format = "%Y-%m-%d"))
    hi<-which(date.header==as.Date(as.character(end.dates[j]), format = "%Y-%m-%d"))
    if(length(low)+length(hi)>0){
      indx<-seq(from=low,to=hi)
      mat[names(start.dates)[j],indx]<- 0
    } else next
  }
  mat.template<-mat
  #get the species
  #species<-unique(data$bin)
  #construct the matrix for each species i
  for(i in 1:length(species)){
    indx<-which(data$species==species[i])
    #dates and cameras when/where the species was photographed
    dates<-data$date[indx]
    cameras<-data$camera[indx]
    dates.cameras<-data.frame(dates,cameras)
    #unique combination of dates and cameras 
    dates.cameras<-unique(dates.cameras)
    #fill in the matrix
    for(j in 1:length(dates.cameras[,1])){
      col<-which(date.header==as.character( dates.cameras[j,1]))
      row<-which(cams==as.character( dates.cameras[j,2]))
      mat[row,col]<-1
    }
    mat.nas<-is.na(mat)
    sum.nas<-apply(mat.nas,2,sum)
    indx.nas<-which(sum.nas==rows)
    if(length(indx.nas)>0){
      mat<-mat[,-indx.nas]
    }
    
    res<-c(res,list(mat))
    #return the matrix to its original form
    mat<-mat.template
  }
  
  names(res)<-species
  #res<-lapply(res,f.dum)
  res #object to return
}

Apply the function to get Tapirus bairdii detection matrix

Code

# filter firs year and make uniques

tbairdi <- f.matrix.creator(katios1)[[1]]

Lets extract percent tree cover 2012 to be used as site covariate

The covariate is coming from MODIS. MOD44B Version 6 Vegetation Continuous Fields (VCF). https://lpdaac.usgs.gov/products/mod44bv006/

We plot the cameras as sf object on top the map and extract the values using the function terra::extract

Code
# load the raster map
per_tree_cov <- rast("C:/CodigoR/WCS-CameraTrap/raster/latlon/Veg_Cont_Fields_Yearly_250m_v61/Perc_TreeCov/MOD44B_Perc_TreeCov_2012_065.tif")

# extract values per camera
per_tre <- terra::extract(per_tree_cov, katios_sf)

# assign values to the sf object
katios_sf$per_tree_cov <- per_tre$MOD44B_Perc_TreeCov_2012_065 
#  fix 200 issue
# ind <- which(sites$per_tree_cov== 200)
# sites$per_tree_cov[ind] <- 0

Create unmarked frame object

Lets use the unmarked package to make an unmarkedFrameOccu object.

Code

umf <- unmarkedFrameOccu(y=tbairdi, 
                         siteCovs=data.frame(
                           per_tree_cov=katios_sf$per_tree_cov)
                           #road_den=sites$roads),
                         # obsCovs=list(effort=ej)
                      )

plot(umf)

Fit models

lets use ubms package to fit models

Code
# fit_0 <- occu(~1~1, data=umf) # unmarked

fit_j0 <- stan_occu(~1~1, data=umf, chains=3, iter=10000, cores=3)
fit_j2 <- stan_occu(~1~scale(per_tree_cov), data=umf, chains=3, iter=10000, cores=3)

Model selection

Code
# compare models
models <- list("p(.)psi(.)" = fit_j0, # put names
                "p(.)psi(per_tree_cov)" = fit_j2) # put names

mods <- fitList(fits = models)

## see model selection as a table
datatable( 
  round(modSel(mods), 3)
  )

The model p(.)psi(per_tree_cov) is the “better”.

Estimates for the null model

Estimated values for the null model p(.)psi(.) are: 0.4412957, 0.0439908 for occupancy, and detection probability respectively.

Details of the best model

Code
fit_j2
#> 
#> Call:
#> stan_occu(formula = ~1 ~ scale(per_tree_cov), data = umf, chains = 3, 
#>     iter = 10000, cores = 3)
#> 
#> Occupancy (logit-scale):
#>                     Estimate   SD   2.5% 97.5% n_eff Rhat
#> (Intercept)           -0.404 0.58 -1.493 0.771  9888    1
#> scale(per_tree_cov)    1.329 0.70  0.145 2.907  9348    1
#> 
#> Detection (logit-scale):
#>  Estimate    SD  2.5% 97.5% n_eff Rhat
#>     -3.09 0.258 -3.63 -2.62  9447    1
#> 
#> LOOIC: 216.825
#> Runtime: 9.094 sec

we conclude MCMC chains have converged if all R>1.05
Convergence here is not that good…

Model convergence

Let see the chains.

Code
traceplot(fit_j2, pars=c("beta_state"))

not that good…

Evaluate model fit

Statistic (p) should be near 0.5 if the model fits well.

Code
# eval
fit_top_gof <- gof(fit_j2, draws=500, quiet=TRUE)
fit_top_gof
#> MacKenzie-Bailey Chi-square 
#> Point estimate = 848041214.544
#> Posterior predictive p = 0.14

# plot(fit_top_gof)

0.14 is not that bad.

Model inference

No covariate for detection, and percent of forest tree cover in occupancy.

Code
# ubms::plot_effects(fit_j2, "det")
ubms::plot_effects(fit_j2, "state")

The error band is large but there is a clear trend.

Spatial model

Taking in to account spatial autocorrelation.

Code
# convert to UTM
katios_utm = st_transform(katios_sf, 21818)
katios_cord <- st_coordinates(katios_utm)
site_cov <- as.data.frame(cbind(per_tree_cov=scale(katios_sf$per_tree_cov),
                  katios_cord))

names(site_cov) <- c("per_tree_cov", "X", "Y")

with(site_cov, RSR(X, Y, threshold=1, plot_site=27))

Code

form <- ~1 ~per_tree_cov + RSR(X, Y, threshold=1)
umf2 <- unmarkedFrameOccu(y=tbairdi, siteCovs=site_cov)
# fit_spatial <- stan_occu(form, umf2, chains=3, cores=3, seed=123) # error

Spatial model do not run… Error at Building RSR matrices: TridiagEigen: eigen decomposition failed. Probably to few sites.

Predict occupancy in a map

Lets use a raster map with percent tree cover to predict the occupancy and see the resulting occupancy as a map.

Code
# cut large raster 
box <- ext(-77.18,-77.11, 7.800, 7.89) # make a box xmin, xmax, ymin, ymax
library(raster)
per_tree_cov_cut <- raster(crop(per_tree_cov, box))# cut raster using the box
# put correct name
names(per_tree_cov_cut) <- "per_tree_cov"
# predict
map_occupancy <- ubms::predict(fit_j2,
                               submodel="state",
                               newdata=per_tree_cov_cut,
                               transform=TRUE)

katios_occu <- map_occupancy[[1]] # assign just prediction
katios_occu[katios_occu >= 0.9] <- NA # convert river to NA

# make a palette 9 colors yellow to green
pal <- grDevices::colorRampPalette(RColorBrewer::brewer.pal(9, "YlGn"))
# plot map
mapview(katios_occu, col.regions= pal, alpha = 0.5) + mapview(katios_sf, cex=2)

Package Citation

Code
pkgs <- cite_packages(output = "paragraph", out.dir = ".") #knitr::kable(pkgs)
pkgs

We used R version 4.3.2 (R Core Team 2023) and the following R packages: camtrapR v. 2.3.0 (Niedballa et al. 2016), devtools v. 2.4.5 (Wickham et al. 2022), DT v. 0.32 (Xie, Cheng, and Tan 2024), elevatr v. 0.99.0 (Hollister et al. 2023), kableExtra v. 1.4.0 (Zhu 2024), mapview v. 2.11.2 (Appelhans et al. 2023), patchwork v. 1.2.0 (Pedersen 2024), quarto v. 1.4 (Allaire and Dervieux 2024), raster v. 3.6.26 (Hijmans 2023), RColorBrewer v. 1.1.3 (Neuwirth 2022), rmarkdown v. 2.27 (Xie, Allaire, and Grolemund 2018; Xie, Dervieux, and Riederer 2020; Allaire et al. 2024), sf v. 1.0.15 (Pebesma 2018; Pebesma and Bivand 2023), styler v. 1.10.3 (Müller and Walthert 2024), terra v. 1.7.71 (Hijmans 2024), tidyverse v. 2.0.0 (Wickham et al. 2019), ubms v. 1.2.6 (Kellner et al. 2021), unmarked v. 1.4.1 (Fiske and Chandler 2011; Kellner et al. 2023).

Sesion info

Session info
#> ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.2 (2023-10-31 ucrt)
#>  os       Windows 10 x64 (build 19042)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language (EN)
#>  collate  Spanish_Colombia.utf8
#>  ctype    Spanish_Colombia.utf8
#>  tz       America/Bogota
#>  date     2024-07-31
#>  pandoc   3.1.11 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
#>  ! package           * version  date (UTC) lib source
#>    abind               1.4-5    2016-07-21 [1] CRAN (R 4.3.1)
#>    backports           1.4.1    2021-12-13 [1] CRAN (R 4.3.1)
#>    base64enc           0.1-3    2015-07-28 [1] CRAN (R 4.3.1)
#>    boot                1.3-28.1 2022-11-22 [2] CRAN (R 4.3.2)
#>    brew                1.0-10   2023-12-16 [1] CRAN (R 4.3.2)
#>    bslib               0.6.1    2023-11-28 [1] CRAN (R 4.3.2)
#>    cachem              1.0.8    2023-05-01 [1] CRAN (R 4.3.2)
#>    camtrapR          * 2.3.0    2024-02-26 [1] CRAN (R 4.3.3)
#>    cellranger          1.1.0    2016-07-27 [1] CRAN (R 4.3.2)
#>    checkmate           2.3.1    2023-12-04 [1] CRAN (R 4.3.2)
#>    class               7.3-22   2023-05-03 [2] CRAN (R 4.3.2)
#>    classInt            0.4-10   2023-09-05 [1] CRAN (R 4.3.2)
#>    cli                 3.6.2    2023-12-11 [1] CRAN (R 4.3.2)
#>    codetools           0.2-19   2023-02-01 [2] CRAN (R 4.3.2)
#>    colorspace          2.1-0    2023-01-23 [1] CRAN (R 4.3.2)
#>    crosstalk           1.2.1    2023-11-23 [1] CRAN (R 4.3.2)
#>    curl                5.2.0    2023-12-08 [1] CRAN (R 4.3.2)
#>    data.table          1.15.0   2024-01-30 [1] CRAN (R 4.3.2)
#>    DBI                 1.2.2    2024-02-16 [1] CRAN (R 4.3.2)
#>    devtools            2.4.5    2022-10-11 [1] CRAN (R 4.3.2)
#>    digest              0.6.34   2024-01-11 [1] CRAN (R 4.3.2)
#>    distributional      0.4.0    2024-02-07 [1] CRAN (R 4.3.2)
#>    dplyr             * 1.1.4    2023-11-17 [1] CRAN (R 4.3.2)
#>    DT                * 0.32     2024-02-19 [1] CRAN (R 4.3.3)
#>    e1071               1.7-14   2023-12-06 [1] CRAN (R 4.3.2)
#>    elevatr           * 0.99.0   2023-09-12 [1] CRAN (R 4.3.2)
#>    ellipsis            0.3.2    2021-04-29 [1] CRAN (R 4.3.2)
#>    evaluate            0.23     2023-11-01 [1] CRAN (R 4.3.2)
#>    fansi               1.0.6    2023-12-08 [1] CRAN (R 4.3.2)
#>    farver              2.1.1    2022-07-06 [1] CRAN (R 4.3.2)
#>    fastmap             1.1.1    2023-02-24 [1] CRAN (R 4.3.2)
#>    forcats           * 1.0.0    2023-01-29 [1] CRAN (R 4.3.2)
#>    fs                  1.6.3    2023-07-20 [1] CRAN (R 4.3.2)
#>    generics            0.1.3    2022-07-05 [1] CRAN (R 4.3.2)
#>    ggplot2           * 3.5.1    2024-04-23 [1] CRAN (R 4.3.3)
#>    glue                1.7.0    2024-01-09 [1] CRAN (R 4.3.2)
#>    grateful          * 0.2.4    2023-10-22 [1] CRAN (R 4.3.3)
#>    gridExtra           2.3      2017-09-09 [1] CRAN (R 4.3.2)
#>    gtable              0.3.4    2023-08-21 [1] CRAN (R 4.3.2)
#>    hms                 1.1.3    2023-03-21 [1] CRAN (R 4.3.2)
#>    htmltools           0.5.7    2023-11-03 [1] CRAN (R 4.3.2)
#>    htmlwidgets         1.6.4    2023-12-06 [1] CRAN (R 4.3.2)
#>    httpuv              1.6.14   2024-01-26 [1] CRAN (R 4.3.2)
#>    inline              0.3.19   2021-05-31 [1] CRAN (R 4.3.2)
#>    jquerylib           0.1.4    2021-04-26 [1] CRAN (R 4.3.2)
#>    jsonlite            1.8.8    2023-12-04 [1] CRAN (R 4.3.2)
#>    kableExtra        * 1.4.0    2024-01-24 [1] CRAN (R 4.3.3)
#>    KernSmooth          2.23-22  2023-07-10 [2] CRAN (R 4.3.2)
#>    knitr               1.46     2024-04-06 [1] CRAN (R 4.3.3)
#>    labeling            0.4.3    2023-08-29 [1] CRAN (R 4.3.1)
#>    later               1.3.2    2023-12-06 [1] CRAN (R 4.3.2)
#>    lattice             0.22-5   2023-10-24 [1] CRAN (R 4.3.2)
#>    leafem              0.2.3    2023-09-17 [1] CRAN (R 4.3.2)
#>    leaflet             2.2.1    2023-11-13 [1] CRAN (R 4.3.2)
#>    leaflet.providers   2.0.0    2023-10-17 [1] CRAN (R 4.3.2)
#>    leafpop             0.1.0    2021-05-22 [1] CRAN (R 4.3.2)
#>    lifecycle           1.0.4    2023-11-07 [1] CRAN (R 4.3.2)
#>    lme4                1.1-35.3 2024-04-16 [1] CRAN (R 4.3.2)
#>    loo                 2.7.0    2024-02-24 [1] CRAN (R 4.3.2)
#>    lubridate         * 1.9.3    2023-09-27 [1] CRAN (R 4.3.2)
#>    magrittr            2.0.3    2022-03-30 [1] CRAN (R 4.3.2)
#>    mapview           * 2.11.2   2023-10-13 [1] CRAN (R 4.3.2)
#>    MASS                7.3-60   2023-05-04 [2] CRAN (R 4.3.2)
#>    Matrix              1.6-1.1  2023-09-18 [2] CRAN (R 4.3.2)
#>    matrixStats         1.2.0    2023-12-11 [1] CRAN (R 4.3.2)
#>    memoise             2.0.1    2021-11-26 [1] CRAN (R 4.3.2)
#>    mgcv                1.9-1    2023-12-21 [1] CRAN (R 4.3.3)
#>    mime                0.12     2021-09-28 [1] CRAN (R 4.3.1)
#>    miniUI              0.1.1.1  2018-05-18 [1] CRAN (R 4.3.2)
#>    minqa               1.2.6    2023-09-11 [1] CRAN (R 4.3.2)
#>    munsell             0.5.0    2018-06-12 [1] CRAN (R 4.3.2)
#>    nlme                3.1-163  2023-08-09 [2] CRAN (R 4.3.2)
#>    nloptr              2.0.3    2022-05-26 [1] CRAN (R 4.3.2)
#>    patchwork         * 1.2.0    2024-01-08 [1] CRAN (R 4.3.3)
#>    pbapply             1.7-2    2023-06-27 [1] CRAN (R 4.3.2)
#>    pillar              1.9.0    2023-03-22 [1] CRAN (R 4.3.2)
#>    pkgbuild            1.4.4    2024-03-17 [1] CRAN (R 4.3.3)
#>    pkgconfig           2.0.3    2019-09-22 [1] CRAN (R 4.3.2)
#>    pkgload             1.3.4    2024-01-16 [1] CRAN (R 4.3.2)
#>    png                 0.1-8    2022-11-29 [1] CRAN (R 4.3.1)
#>    posterior           1.5.0    2023-10-31 [1] CRAN (R 4.3.2)
#>    processx            3.8.3    2023-12-10 [1] CRAN (R 4.3.2)
#>    profvis             0.3.8    2023-05-02 [1] CRAN (R 4.3.2)
#>    progressr           0.14.0   2023-08-10 [1] CRAN (R 4.3.2)
#>    promises            1.2.1    2023-08-10 [1] CRAN (R 4.3.2)
#>    proxy               0.4-27   2022-06-09 [1] CRAN (R 4.3.2)
#>    ps                  1.7.6    2024-01-18 [1] CRAN (R 4.3.2)
#>    purrr             * 1.0.2    2023-08-10 [1] CRAN (R 4.3.2)
#>    quarto            * 1.4      2024-03-06 [1] CRAN (R 4.3.3)
#>    QuickJSR            1.1.3    2024-01-31 [1] CRAN (R 4.3.2)
#>    R.cache             0.16.0   2022-07-21 [1] CRAN (R 4.3.3)
#>    R.methodsS3         1.8.2    2022-06-13 [1] CRAN (R 4.3.3)
#>    R.oo                1.26.0   2024-01-24 [1] CRAN (R 4.3.3)
#>    R.utils             2.12.3   2023-11-18 [1] CRAN (R 4.3.3)
#>    R6                  2.5.1    2021-08-19 [1] CRAN (R 4.3.2)
#>    raster            * 3.6-26   2023-10-14 [1] CRAN (R 4.3.2)
#>    RColorBrewer        1.1-3    2022-04-03 [1] CRAN (R 4.3.1)
#>    Rcpp                1.0.12   2024-01-09 [1] CRAN (R 4.3.2)
#>    RcppNumerical       0.6-0    2023-09-06 [1] CRAN (R 4.3.3)
#>  D RcppParallel        5.1.7    2023-02-27 [1] CRAN (R 4.3.2)
#>    readr             * 2.1.5    2024-01-10 [1] CRAN (R 4.3.2)
#>    readxl            * 1.4.3    2023-07-06 [1] CRAN (R 4.3.2)
#>    remotes             2.5.0    2024-03-17 [1] CRAN (R 4.3.3)
#>    renv                1.0.7    2024-04-11 [1] CRAN (R 4.3.3)
#>    rlang               1.1.3    2024-01-10 [1] CRAN (R 4.3.2)
#>    rmarkdown           2.27     2024-05-17 [1] CRAN (R 4.3.3)
#>    RSpectra            0.16-1   2022-04-24 [1] CRAN (R 4.3.2)
#>    rstan               2.32.6   2024-03-05 [1] CRAN (R 4.3.3)
#>    rstantools          2.4.0    2024-01-31 [1] CRAN (R 4.3.2)
#>    rstudioapi          0.16.0   2024-03-24 [1] CRAN (R 4.3.3)
#>    sass                0.4.8    2023-12-06 [1] CRAN (R 4.3.2)
#>    satellite           1.0.5    2024-02-10 [1] CRAN (R 4.3.2)
#>    scales              1.3.0    2023-11-28 [1] CRAN (R 4.3.3)
#>    secr                4.6.6    2024-02-29 [1] CRAN (R 4.3.3)
#>    sessioninfo         1.2.2    2021-12-06 [1] CRAN (R 4.3.2)
#>    sf                * 1.0-15   2023-12-18 [1] CRAN (R 4.3.2)
#>    shiny               1.8.0    2023-11-17 [1] CRAN (R 4.3.2)
#>    sp                * 2.1-3    2024-01-30 [1] CRAN (R 4.3.2)
#>    StanHeaders         2.32.5   2024-01-10 [1] CRAN (R 4.3.2)
#>    stringi             1.8.3    2023-12-11 [1] CRAN (R 4.3.2)
#>    stringr           * 1.5.1    2023-11-14 [1] CRAN (R 4.3.2)
#>    styler            * 1.10.3   2024-04-07 [1] CRAN (R 4.3.3)
#>    svglite             2.1.3    2023-12-08 [1] CRAN (R 4.3.2)
#>    systemfonts         1.0.5    2023-10-09 [1] CRAN (R 4.3.2)
#>    tensorA             0.36.2.1 2023-12-13 [1] CRAN (R 4.3.2)
#>    terra             * 1.7-71   2024-01-31 [1] CRAN (R 4.3.2)
#>    tibble            * 3.2.1    2023-03-20 [1] CRAN (R 4.3.2)
#>    tidyr             * 1.3.1    2024-01-24 [1] CRAN (R 4.3.2)
#>    tidyselect          1.2.1    2024-03-11 [1] CRAN (R 4.3.3)
#>    tidyverse         * 2.0.0    2023-02-22 [1] CRAN (R 4.3.2)
#>    timechange          0.3.0    2024-01-18 [1] CRAN (R 4.3.2)
#>    tzdb                0.4.0    2023-05-12 [1] CRAN (R 4.3.2)
#>    ubms              * 1.2.6    2023-09-11 [1] CRAN (R 4.3.2)
#>    units               0.8-5    2023-11-28 [1] CRAN (R 4.3.2)
#>    unmarked          * 1.4.1    2024-01-09 [1] CRAN (R 4.3.2)
#>    urlchecker          1.0.1    2021-11-30 [1] CRAN (R 4.3.2)
#>    usethis             2.2.3    2024-02-19 [1] CRAN (R 4.3.2)
#>    utf8                1.2.4    2023-10-22 [1] CRAN (R 4.3.2)
#>    uuid                1.2-0    2024-01-14 [1] CRAN (R 4.3.2)
#>    V8                  4.4.2    2024-02-15 [1] CRAN (R 4.3.3)
#>    vctrs               0.6.5    2023-12-01 [1] CRAN (R 4.3.2)
#>    viridisLite         0.4.2    2023-05-02 [1] CRAN (R 4.3.2)
#>    withr               3.0.0    2024-01-16 [1] CRAN (R 4.3.2)
#>    xfun                0.44     2024-05-15 [1] CRAN (R 4.3.3)
#>    xml2                1.3.6    2023-12-04 [1] CRAN (R 4.3.2)
#>    xtable              1.8-4    2019-04-21 [1] CRAN (R 4.3.2)
#>    yaml                2.3.8    2023-12-11 [1] CRAN (R 4.3.2)
#> 
#>  [1] C:/Users/usuario/AppData/Local/R/win-library/4.3
#>  [2] C:/Program Files/R/R-4.3.2/library
#> 
#>  D ── DLL MD5 mismatch, broken installation.
#> 
#> ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

References

Allaire, JJ, and Christophe Dervieux. 2024. quarto: R Interface to Quarto Markdown Publishing System. https://CRAN.R-project.org/package=quarto.
Allaire, JJ, Yihui Xie, Christophe Dervieux, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, et al. 2024. rmarkdown: Dynamic Documents for r. https://github.com/rstudio/rmarkdown.
Appelhans, Tim, Florian Detsch, Christoph Reudenbach, and Stefan Woellauer. 2023. mapview: Interactive Viewing of Spatial Data in r. https://CRAN.R-project.org/package=mapview.
Fiske, Ian, and Richard Chandler. 2011. unmarked: An R Package for Fitting Hierarchical Models of Wildlife Occurrence and Abundance.” Journal of Statistical Software 43 (10): 1–23. https://www.jstatsoft.org/v43/i10/.
Hijmans, Robert J. 2023. raster: Geographic Data Analysis and Modeling. https://CRAN.R-project.org/package=raster.
———. 2024. terra: Spatial Data Analysis. https://CRAN.R-project.org/package=terra.
Hollister, Jeffrey, Tarak Shah, Jakub Nowosad, Alec L. Robitaille, Marcus W. Beck, and Mike Johnson. 2023. elevatr: Access Elevation Data from Various APIs. https://doi.org/10.5281/zenodo.8335450.
Kellner, Kenneth F., Nicholas L. Fowler, Tyler R. Petroelje, Todd M. Kautz, Dean E. Beyer, and Jerrold L. Belant. 2021. ubms: An R Package for Fitting Hierarchical Occupancy and n-Mixture Abundance Models in a Bayesian Framework.” Methods in Ecology and Evolution 13: 577–84. https://doi.org/10.1111/2041-210X.13777.
Kellner, Kenneth F., Adam D. Smith, J. Andrew Royle, Marc Kery, Jerrold L. Belant, and Richard B. Chandler. 2023. “The unmarked R Package: Twelve Years of Advances in Occurrence and Abundance Modelling in Ecology.” Methods in Ecology and Evolution 14 (6): 1408–15. https://www.jstatsoft.org/v43/i10/.
Müller, Kirill, and Lorenz Walthert. 2024. styler: Non-Invasive Pretty Printing of r Code. https://CRAN.R-project.org/package=styler.
Neuwirth, Erich. 2022. RColorBrewer: ColorBrewer Palettes. https://CRAN.R-project.org/package=RColorBrewer.
Niedballa, Jürgen, Rahel Sollmann, Alexandre Courtiol, and Andreas Wilting. 2016. camtrapR: An r Package for Efficient Camera Trap Data Management.” Methods in Ecology and Evolution 7 (12): 1457–62. https://doi.org/10.1111/2041-210X.12600.
Pebesma, Edzer. 2018. Simple Features for R: Standardized Support for Spatial Vector Data.” The R Journal 10 (1): 439–46. https://doi.org/10.32614/RJ-2018-009.
Pebesma, Edzer, and Roger Bivand. 2023. Spatial Data Science: With applications in R. Chapman and Hall/CRC. https://doi.org/10.1201/9780429459016.
Pedersen, Thomas Lin. 2024. patchwork: The Composer of Plots. https://CRAN.R-project.org/package=patchwork.
R Core Team. 2023. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.
Wickham, Hadley, Jim Hester, Winston Chang, and Jennifer Bryan. 2022. devtools: Tools to Make Developing r Packages Easier. https://CRAN.R-project.org/package=devtools.
Xie, Yihui, J. J. Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown.
Xie, Yihui, Joe Cheng, and Xianying Tan. 2024. DT: A Wrapper of the JavaScript Library DataTables. https://CRAN.R-project.org/package=DT.
Xie, Yihui, Christophe Dervieux, and Emily Riederer. 2020. R Markdown Cookbook. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown-cookbook.
Zhu, Hao. 2024. kableExtra: Construct Complex Table with kable and Pipe Syntax. https://CRAN.R-project.org/package=kableExtra.

Citation

BibTeX citation:
@online{j._lizcano2024,
  author = {J. Lizcano, Diego},
  title = {Single {Season} {Occupancy} {Model}},
  date = {2024-07-17},
  url = {https://dlizcano.github.io/cametrapcesar/posts/2024-07-29-sigle-season-occupancy/},
  langid = {en}
}
For attribution, please cite this work as:
J. Lizcano, Diego. 2024. “Single Season Occupancy Model.” July 17, 2024. https://dlizcano.github.io/cametrapcesar/posts/2024-07-29-sigle-season-occupancy/.