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

Data Structure

The universal data structure we're going to use is:

If both abundance and covariates are present in the list, then the two data.frames must have the same number of rows.

abundance

In the abundance data.frame:

Here, the common usage is for each column to be a species or taxon, and each row to be an observed sample. In other words, each column is a time series, with the rows sorted such that time advances down (higher row indices correspond to later times).

covariates

In the covariates data.frame:

The number of rows should match that of abundance, and rows of covariates should line up with abundance (either sampled simultaneously or concurrently). Common covariates are date and time, temperature, treatments, etc.

metadata

In the metadata list:

Example Data

Here is an example of a correctly formatted dataset with covariates and metadata:

library(MATSS)
data(dragons)

str(dragons)

We can view the abundance and covariates tables side by side:

knitr::kable(dragons[c("abundance", "covariates")])

Checking Data

We also provide a function for checking whether the data is formatted correctly:

check_data_format(dragons)


weecology/MATSS documentation built on May 15, 2020, 7:03 p.m.