The recommended workflow to wrangle together data for analysis in wildRtrax
is as follows. Once you have your data from wt_download_report()
.
wt_tidy_species()
wt_replace_tmtt()
wt_make_wide()
wt_qpad_offsets()
knitr::opts_chunk$set( collapse = TRUE, comment = '#>' ) load("package.RData")
# Attach package library(wildRtrax) library(tidyverse)
# Start by getting everything you need Sys.setenv(WT_USERNAME = 'guest', WT_PASSWORD = 'Apple123') wt_auth() my_report <- wt_download_report(project_id = 605, sensor_id = 'ARU', reports = "main", weather_cols = F) %>% tibble::as_tibble()
Now let's start cleaning things up a bit. We don't need certain abiotic codes so let's remove those with wt_tidy_species()
,
my_tidy_data <- wt_tidy_species(my_report, remove = "mammal", zerofill=F) # Difference in rows round((nrow(my_tidy_data)/nrow(my_report)),2)
So about 5% of detections were mammals. Next, convert TMTT counts to numeric:
my_tmtt_data <- wt_replace_tmtt(data = my_tidy_data, calc = "round")
and finally widen the data into a species matrix.
my_wide_data <- wt_make_wide(data = my_tmtt_data, sound = "all") head(my_wide_data)
Now you can calculate statistical offsets to account for imperfection detection following the QPAD method.
my_offset_data <- wt_qpad_offsets(data = my_wide_data, species = "all", version = 3, together = TRUE) head(my_offset_data)
You can also perform a single-season, single-species occupancy work flow using wt_format_occupancy()
once the data is downloaded.
dat.occu <- wt_format_occupancy(my_report, species="WTSP", siteCovs=NULL) mod <- unmarked::occu(~ 1 ~ 1, dat.occu) mod
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.