knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

azmpdata

Travis build status

The R package azmpdata provides a series of data products derived from raw data collected as part of the Atlantic Zone Monitoring Program (AZMP). The data products provided in this package are used to generate the different figures contained in the Research Documents produced annually by Fisheries and Ocean Canada's Maritimes region. The Research Documents describe the physical, chemical and biological conditions observed in Maritimes region since the inception of the AZMP program (see example documents for the physical conditions and for the optical, chemical and biological conditions).

Package Installation

The azmpdata R package can be installed from GitHub with:

# install.packages("devtools")
devtools::install_github("casaultb/azmpdata")

Datasets

The azmpdata package provides three types of data products: physical, chemical and biological variables, which are summarized below. Each data product is organized into a data table by temporal and regional scale and category.

To access a dataset in data frame format:

library(azmpdata)
data("Derived_Annual_Broadscale")
head(Derived_Annual_Broadscale)

To access a dataset in csv format:

system.file("extdata/csv", "Derived_Annual_Broadscale.csv", package = "azmpdata")

Variable Organization

Each table contains multiple variables, which fall under the temporal and regional scale in a particular category. The example shown above includes derived variables at an annual scale for broad regions (eg. Scotian Shelf or Gulf of Maine). Variables can be found via the search function variable_lookup(), which allows a user to search by variable name or keyword. For more information see ?variable_lookup. This function searches through variable names and (optionally) help files from each dataset including metadata and variable definitions.

Package Functionality

Although the main goal of azmpdata is to provide easy access to a variety of data products, the package also supports a few basic functions for which examples are shown below.

Searching Data

A custom search function has been developed in order to allow users to find specific data. The function variable_lookup() can be used to search through variable names in all azmpdata dataframes. Using the argument search_help, this function can also search through all the help text for package data. A sample use of this search function may look as below:

res <- variable_lookup(keywords = c('nitrate', 'phosphate'), search_help = TRUE)

head(res)

Dataset Documentation

A detailed description of the whole package is available using the following command:

library(azmpdata)
help("azmpdata")

In addition, each dataset is documented and the following command returns a detailed description about a given dataset:

library(azmpdata)
help("Derived_Annual_Broadscale")

Plotting

Plotting azmpdata is covered in a detailed vignette plotting_azmpdata.

For developers

Data managers and developers may need to update data within the package. For more details on this process, please see the vignette update_azmpdata. The vignette style_guide also provides more details on the formatting of new data.



casaultb/azmpdata documentation built on July 4, 2025, 11:04 a.m.