Ver camaras

Risaralda y Quindio

Risaralda_sf <-  st_as_sf(Risaralda_data, coords = c("Longitude", "Latitude"), crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0")

cams_plot <- mapview(Risaralda_sf, zcol = "Photo Type",
                     color = c("black","red"),
                    legend = FALSE, 
        map.types = "Esri.WorldImagery")


Quindio_sf <-  st_as_sf(Quindio_data, coords = c("Longitud", "Latitud"), crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0")


# cams_plot
### Risaralda
cam_location_R <- unique(Risaralda_data[,c('Latitude','Longitude','Camera_Trap')])
                  #as.data.frame(unique(cbind(Risaralda_data$Longitude,
                             #Risaralda_data$Latitude)))

#### Quindio #### las Camaras se sobrelapan
cam_location_Q <- unique(Quindio_data[,c('Latitud','Longitud','camara')])


cams_sp_R <- st_as_sf(cam_location_R, coords = c("Longitude", "Latitude"), crs = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0")

centroid <- c(mean(Risaralda_data$Longitude), mean(Risaralda_data$Latitude))

cams_sp_Q <- as(Quindio_sf, "Spatial")

 ##################################
 # set extent get SRTM
 ##################################

clip_window <- extent(-75.60 , -75.39, 4.59, 4.81)
srtm <- raster::getData('SRTM', lon=centroid[1], lat=centroid[2])

# plot(clip_window,  border = "blue") 
# plot(cams_sp, add=TRUE)

# crop the  raster using the vector extent
srtm_crop <- crop(srtm, clip_window)

# extract altitudes
cam_location_R$Elev_R <- raster::extract(srtm_crop, cams_sp_R)
cam_location_Q$Elev_Q <- raster::extract(srtm_crop, cams_sp_Q)
cam_location_Q <- as.data.frame(cam_location_Q) # convert to Data frame

# unify names
names(cam_location_Q) <- c("Latitud", "Longitud", "camera", "Elev")
names(cam_location_R) <- c("Latitud", "Longitud", "camera", "Elev")
full_covs <- rbind(cam_location_R, cam_location_Q)

# plot(srtm_crop) 
# plot(cams_sp, add=TRUE)

# view
pal = mapviewPalette("mapviewTopoColors")

Risaralda_sf %>% group_by(Camera_Trap) %>%
    summarise(mean = mean("Number of Animals", na.omit=T), fotos = n()) %>%
    filter(fotos > 1) %>%
    mapview (cex = "fotos", zcol = "fotos", legend = TRUE) + 
  mapview (srtm_crop, col.regions = pal(400), at = seq(1000, 5000, 10), alpha=0.7) + 
  mapview(Risaralda_sf, cex = 1) + mapview(st_jitter(Quindio_sf, factor = 0.03),  alpha = 0, cex = 4, zcol = "camara")

Analisis de Ocupación

Crea objetos UMF

## unmarkedFrame Object
## 
## 28 sites
## Maximum number of observations per site: 108 
## Mean number of observations per site: 34.25 
## Sites with at least one detection: 11 
## 
## Tabulation of y observations:
##    0    1 <NA> 
##  938   21 2065 
## 
## Site-level covariates:
##     Helechos        Frailejones        Cob_dosel          Cob_arb       
##  Min.   :-0.6320   Min.   :-0.6687   Min.   :-0.9933   Min.   :-1.9423  
##  1st Qu.:-0.6320   1st Qu.:-0.6687   1st Qu.:-0.9933   1st Qu.:-0.4645  
##  Median :-0.5303   Median :-0.6687   Median : 0.1256   Median : 0.2252  
##  Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000  
##  3rd Qu.: 0.2833   3rd Qu.: 0.4377   3rd Qu.: 0.8049   3rd Qu.: 0.8163  
##  Max.   : 3.0291   Max.   : 2.0548   Max.   : 1.5642   Max.   : 1.6045  
##    Cobert_her           DAP               Alti              Temp        
##  Min.   :-1.7738   Min.   :-0.9793   Min.   :-2.1097   Min.   :-1.2904  
##  1st Qu.:-0.8955   1st Qu.:-0.7335   1st Qu.:-0.6012   1st Qu.:-0.7277  
##  Median : 0.5418   Median :-0.2162   Median : 0.2183   Median :-0.1926  
##  Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000   Mean   : 0.0000  
##  3rd Qu.: 0.7814   3rd Qu.: 0.3658   3rd Qu.: 0.7265   3rd Qu.: 0.2417  
##  Max.   : 0.7814   Max.   : 3.8062   Max.   : 1.4488   Max.   : 2.3453

## unmarkedFrame Object
## 
## 59 sites
## Maximum number of observations per site: 96 
## Mean number of observations per site: 45.32 
## Sites with at least one detection: 7 
## 
## Tabulation of y observations:
##    0    1 <NA> 
## 2658   16 2990

Selección de modelos

##                       nPars    AIC delta   AICwt cumltvWt
## p(.) Ocu(DAP + Alt)       4 189.85  0.00 0.94361     0.94
## p(.) Ocu(DAP)             3 197.56  7.71 0.01999     0.96
## p(.) Ocu(Alti2)           4 198.97  9.12 0.00988     0.97
## p(.) Ocu(Alti)            3 199.03  9.18 0.00959     0.98
## p(.) Ocu(.)               2 200.08 10.22 0.00569     0.99
## p(.) Ocu(Temp)            3 200.71 10.86 0.00414     0.99
## p(.) Ocu(Cob_arb)         3 201.06 11.21 0.00348     1.00
## p(.) Ocu(Helechos)        3 201.76 11.91 0.00245     1.00
## p(.) Ocu(Cobert_her)      3 203.59 13.73 0.00098     1.00
## p(.) Ocu(Frailejones)     3 206.86 17.00 0.00019     1.00

Que tan bueno es el ajuste del modelo?

## t0 = 20.26135

## 
## Call:
## occu(formula = ~1 ~ DAP + Alti, data = umf_Q)
## 
## Occupancy (logit-scale):
##             Estimate    SE      z P(>|z|)
## (Intercept)     7.56  20.5  0.370   0.712
## DAP          -140.75 320.8 -0.439   0.661
## Alti          -59.39 142.2 -0.418   0.676
## 
## Detection (logit-scale):
##  Estimate    SE     z  P(>|z|)
##     -3.31 0.222 -14.9 3.04e-50
## 
## AIC: 189.8538 
## Number of sites: 28
## optim convergence code: 0
## optim iterations: 121 
## Bootstrap iterations: 0

Un modelo simple con la unica covariable comun a Quindio y Risaralda

Altitud en graficas

##                  nPars    AIC delta   AICwt cumltvWt
## p(.) Ocu(Elev^2)     4 368.33  0.00 6.6e-01     0.66
## p(.) Ocu(Elev)       3 369.73  1.40 3.3e-01     0.99
## p(.) Ocu(Elev^3)     4 376.33  8.00 1.2e-02     1.00
## p(.) Ocu(.)          2 417.05 48.72 1.7e-11     1.00
## t0 = 36.43499

La altitud es buena predictora de la ocupación. la ocupación aumente con la altitud hasta los 3100 metros, luego de esta altitud la ocupación disminuye lentamente.

Modelo de Ocupación explicado por altitud espacialmente explicito.

##   doing row 1000 of 66528 
##   doing row 2000 of 66528 
##   doing row 3000 of 66528 
##   doing row 4000 of 66528 
##   doing row 5000 of 66528 
##   doing row 6000 of 66528 
##   doing row 7000 of 66528 
##   doing row 8000 of 66528 
##   doing row 9000 of 66528 
##   doing row 10000 of 66528 
##   doing row 11000 of 66528 
##   doing row 12000 of 66528 
##   doing row 13000 of 66528 
##   doing row 14000 of 66528 
##   doing row 15000 of 66528 
##   doing row 16000 of 66528 
##   doing row 17000 of 66528 
##   doing row 18000 of 66528 
##   doing row 19000 of 66528 
##   doing row 20000 of 66528 
##   doing row 21000 of 66528 
##   doing row 22000 of 66528 
##   doing row 23000 of 66528 
##   doing row 24000 of 66528 
##   doing row 25000 of 66528 
##   doing row 26000 of 66528 
##   doing row 27000 of 66528 
##   doing row 28000 of 66528 
##   doing row 29000 of 66528 
##   doing row 30000 of 66528 
##   doing row 31000 of 66528 
##   doing row 32000 of 66528 
##   doing row 33000 of 66528 
##   doing row 34000 of 66528 
##   doing row 35000 of 66528 
##   doing row 36000 of 66528 
##   doing row 37000 of 66528 
##   doing row 38000 of 66528 
##   doing row 39000 of 66528 
##   doing row 40000 of 66528 
##   doing row 41000 of 66528 
##   doing row 42000 of 66528 
##   doing row 43000 of 66528 
##   doing row 44000 of 66528 
##   doing row 45000 of 66528 
##   doing row 46000 of 66528 
##   doing row 47000 of 66528 
##   doing row 48000 of 66528 
##   doing row 49000 of 66528 
##   doing row 50000 of 66528 
##   doing row 51000 of 66528 
##   doing row 52000 of 66528 
##   doing row 53000 of 66528 
##   doing row 54000 of 66528 
##   doing row 55000 of 66528 
##   doing row 56000 of 66528 
##   doing row 57000 of 66528 
##   doing row 58000 of 66528 
##   doing row 59000 of 66528 
##   doing row 60000 of 66528 
##   doing row 61000 of 66528 
##   doing row 62000 of 66528 
##   doing row 63000 of 66528 
##   doing row 64000 of 66528 
##   doing row 65000 of 66528 
##   doing row 66000 of 66528

Session Info

Details and pakages used

## R version 3.6.1 (2019-07-05)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 14393)
## 
## Matrix products: default
## 
## attached base packages:
## [1] parallel  stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] RColorBrewer_1.1-2 plyr_1.8.5         lubridate_1.7.4    tmaptools_2.0-2   
##  [5] tmap_2.3-2         mapview_2.7.0      readxl_1.3.1       forcats_0.4.0     
##  [9] stringr_1.4.0      dplyr_0.8.3        purrr_0.3.3        readr_1.3.1       
## [13] tidyr_1.0.0        tibble_2.1.3       ggplot2_3.2.1      tidyverse_1.3.0   
## [17] unmarked_0.13-1    reshape2_1.4.3     Rcpp_1.0.3         lattice_0.20-38   
## [21] sf_0.8-0           raster_3.0-7       sp_1.3-2          
## 
## loaded via a namespace (and not attached):
##  [1] leafem_0.0.1            colorspace_1.4-1        class_7.3-15           
##  [4] leaflet_2.0.3           rgdal_1.4-8             satellite_1.0.2        
##  [7] base64enc_0.1-3         fs_1.3.1                dichromat_2.0-0        
## [10] rstudioapi_0.10         farver_2.0.3            fansi_0.4.1            
## [13] xml2_1.2.2              codetools_0.2-16        knitr_1.27             
## [16] zeallot_0.1.0           jsonlite_1.6            broom_0.5.3            
## [19] dbplyr_1.4.2            png_0.1-7               rgeos_0.5-2            
## [22] shiny_1.4.0             compiler_3.6.1          httr_1.4.1             
## [25] backports_1.1.5         assertthat_0.2.1        Matrix_1.2-17          
## [28] fastmap_1.0.1           lazyeval_0.2.2          cli_2.0.1              
## [31] later_1.0.0             leaflet.providers_1.9.0 htmltools_0.4.0        
## [34] tools_3.6.1             gtable_0.3.0            glue_1.3.1             
## [37] cellranger_1.1.0        vctrs_0.2.1             svglite_1.2.2          
## [40] nlme_3.1-140            leafsync_0.1.0          crosstalk_1.0.0        
## [43] lwgeom_0.1-7            xfun_0.12               rvest_0.3.5            
## [46] mime_0.8                lifecycle_0.1.0         XML_3.98-1.20          
## [49] MASS_7.3-51.4           scales_1.1.0            hms_0.5.3              
## [52] promises_1.1.0          yaml_2.2.0              gdtools_0.2.1          
## [55] stringi_1.4.4           leafpop_0.0.5           e1071_1.7-3            
## [58] rlang_0.4.2             pkgconfig_2.0.3         systemfonts_0.1.1      
## [61] evaluate_0.14           htmlwidgets_1.5.1       tidyselect_0.2.5       
## [64] magrittr_1.5            R6_2.4.1                generics_0.0.2         
## [67] DBI_1.1.0               pillar_1.4.3            haven_2.2.0            
## [70] withr_2.1.2             units_0.6-5             modelr_0.1.5           
## [73] crayon_1.3.4            uuid_0.1-2              KernSmooth_2.23-15     
## [76] rmarkdown_2.1           grid_3.6.1              reprex_0.3.0           
## [79] digest_0.6.23           classInt_0.4-2          webshot_0.5.2          
## [82] xtable_1.8-4            httpuv_1.5.2            brew_1.0-6             
## [85] stats4_3.6.1            munsell_0.5.0           viridisLite_0.3.0

Cited Literature