Skip to content

This is an R package that enables environmental sensor users to create comprehensive work flows for managing and analyzing data

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

ABbiodiversity/wildrtrax

Repository files navigation

wildrtrax

Lifecycle: stable CRAN status Codecov test coverage DOI R-CMD-check

Overview

wildrtrax (pronounced wild-r-tracks) is an R package containing functions to help manage and analyze environmental sensor data. It helps to simplify the entire data life cycle by offering tools for data pre-processing, wrangling, and analysis, facilitating seamless data transfer to and from WildTrax. With wildrtrax, users can effortlessly establish end-to-end workflows and ensure reproducibility in their analyses. By providing a consistent and organized framework, the package promotes transparency and integrity in research, making it effortless to share and replicate results.

Installation

You can install the most recent version of wildrtrax directly from this repository with:

# install.packages("remotes")
remotes::install_github("ABbiodiversity/wildrtrax")

The development version of this package contains experimental features and recent fixes. It can be installed with:

remotes::install_github("ABbiodiversity/wildrtrax@development")

The development version of the package will be periodically merged and will be reflected in the Changelogs.

Usage

All functions begin with a wt_* prefix. Column names and metadata align with the WildTrax infrastructure. The goal is to follow the work flow of pre-processing, linking with WildTrax, download and analysis.

Acoustic work flow

Download data and run and a single-season single-species occupancy analysis. Consult APIs and Acoustic data wrangling for more information.

library(wildrtrax)
library(tidyverse)

# OAuth logins only. Google OAuth2 will be supported soon.
Sys.setenv(WT_USERNAME = "*****", WT_PASSWORD = "*****")

# Authenticate to WildTrax
wt_auth()

# Get a project id
projects <- wt_get_download_summary("ARU") |>
  filter(project == "ABMI Ecosystem Health 2023") |>
  select(project_id) |>
  pull()

# Download the main report
data <- map_dfr(.x = projects, .f = ~wt_download_report(.x, "ARU", weather_cols = F, reports = "main")

# Format to occupancy for OVEN
dat.occu <- wt_format_occupancy(my_report, species="OVEN", siteCovs=NULL)

# Run the model
mod <- unmarked::occu(~ 1 ~ 1, dat.occu)
mod

Conduct some pre-processing on various types of acoustic data. See more in Acoustic pre-processing.

library(wildrtrax)
library(tidyverse)

# Scan files and filter results
files <- wt_audio_scanner(path = ".", file_type = "wav", extra_cols = T) |>
              mutate(hour = as.numeric(format(recording_date_time, "%H"))) |>
              filter(julian == 176, hour %in% c(4:8))
              
# Run acoustic indices and LDFCs
wt_run_ap(x = my_files, output_dir = paste0(root, 'ap_outputs'), path_to_ap = '/where/you/store/AP')

wt_glean_ap(my_files |>
    mutate(hour = as.numeric(format(recording_date_time, "%H"))) |>
    filter(between(julian,110,220), hour %in% c(0:3,22:23)), input_dir = ".../ap_outputs", purpose = "biotic")

Camera work flow

The ultimate pipeline for your camera data work flows. See Camera data wrangling for more information.

library(wildrtrax)
library(tidyverse)

# OAuth logins only. Google OAuth2 will be supported soon.
Sys.setenv(WT_USERNAME = "*****", WT_PASSWORD = "*****")

# Authenticate to WildTrax
wt_auth()

# Get a project id
projects <- wt_get_download_summary("CAM") |>
  filter(project == "ABMI Ecosystem Health 2014") |>
  select(project_id) |>
  pull()

# Download the data
raw_data <- map_dfr(.x = projects, .f = ~wt_download_report(.x, "CAM", weather_cols = F, reports = "main")

# Summarise individual detections and calculate detections per day in long format
summarised <- wt_ind_detect(raw_data, 30, "minutes") |>
              wt_summarise_cam(raw_data, "day", "detections", "long")

Ultrasonic work flow

Format tags from Kaleidoscope for a WildTrax project. Download data from a project into an NABAT acceptable format.

library(wildrtrax)
library(tidyverse)

Point count work flow

Download combined and formatted acoustic and point count datasets together

library(wildrtrax)
library(tidyverse)

Issues

To report bugs, request additional features, or get help using the package, please file an issue.

Contributors

We encourage ongoing contributions and collaborations to improve the package into the future. The Alberta Biodiversity Monitoring Institute provides ongoing support, development and funding.

License

This R package is licensed under MIT license©2024 Alberta Biodiversity Monitoring Institute.

Code of Conduct

Please note that wildrtrax is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

About

This is an R package that enables environmental sensor users to create comprehensive work flows for managing and analyzing data

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages