Layers object which pulls together all the data layers for calculating scores, along with their metadata.

Arguments

layers.csv

path to comma-seperated value file with a row of metadata for each dataset (or layer) used in OHI analysis.

layers.dir

full path to the directory containing the layers files (the csv files that correspond to each entry in layers.csv).

Value

Object (non-instantiated) reference class, containing

  • meta - metadata data frame of original layers.csv

  • data - named list of data frames, one per layer

  • targets - a named list of character vectors indicating a layer's targets, goal (status, trend) or dimension (pressures, resilience)

Details

This function creates an R object that combines into a single object all the information from the layers files in layers.dir and the layers.csv metadata. Individual layers can be accessed as: layer_object_name$data$layer_name. To create this object: Layers(dir). The layers.dir should contain all the csv filenames listed in the layers.csv file and is expected to have the following columns:

  • layer - unique layer identifier (no spaces or special characters)

  • targets - a space delimited list of targets (goal code, 'Pressures', 'Resilience' or 'Regions') for which this layer is applied

  • name - name of the variable

  • description - detailed description

  • units - units of the value

  • citation - reference for documentation, typically a heading code for a supplemental document

  • filename - the csv data file for the layer

  • fld_value - required field in the layer csv file containing the value, which is often best named as a shorthand for the units without spaces or special characters

The layers.dir directory should contain all csv filenames listed in the layers.csv file.