SQOUnified: Compute the SQO index scores. Based on the Technical Manual -...

View source: R/SQOUnified.R

SQOUnifiedR Documentation

Compute the SQO index scores. Based on the Technical Manual - June 2021 edition https://ftp.sccwrp.org/pub/download/DOCUMENTS/TechnicalReports/777_CASQO_TechnicalManual.pdf

Description

When this function is called, it will calculate scores based on whatever data is passed into it. If Chem, Tox, and Benthic are provided, integrated scores will be calculated based on the 3 LOE's.

Usage

SQOUnified(
  benthic = NULL,
  chem = NULL,
  tox = NULL,
  logfile = file.path(getwd(), "logs", format(Sys.time(), "%Y-%m-%d_%H:%M:%S"),
    "log.Rmd"),
  verbose = F
)

Arguments

benthic

a data frame. This data frame must contain the following information with these headings:

StationID - an alpha-numeric identifier of the location;

Replicate - a numeric identifying the replicate number of samples taken at the location;

SampleDate - the date of sample collection;

Latitude - latitude in decimal degrees;

Longitude - longitude in decimal degrees. Make sure there is a negative sign for the Western coordinates;

Taxon - name of the fauna, ideally in SCAMIT ed12 format, do not use sp. or spp., use sp only or just the Genus. If no animals were present in the sample use NoOrganismsPresent with 0 abundance;

Abundance - the number of each Species observed in a sample;

Salinity - the salinity observed at the location in PSU, ideally at time of sampling;

Stratum - The stratum under which the station falls (Bays, Estuaries, etc);

Exclude - Yes or No;

chem

a dataframe with the following columns:

StationID

AnalyteName

Result

RL

MDL

units (optional) - Metals should be in mg/dry kg (mg/kg dw) and all organic constituents should be in ug/dry kg (ug/kg dw).

fieldrep (optional) - data will be filtered to where fieldrep = 1

labrep (optional) - data will be filtered to where labrep = 1

sampletypecode (optional) - data will be filtered to where sampletypecode = Result (to avoid including data from QA/QC samples)

toxresults

a dataframe with the following columns: stationid, toxbatch, species, sampletypecode matrix, labrep, result. This data must also include the control samples (stationcode 0000, sampletypecode CNEG etc)

The input dataframe is structured as follows

lab - (optional) The laboratory which performed the test

stationid - an alpha-numeric identifier of the location;

toxbatch - the toxbatch id - used to join with the control sample

species - The Genus and species of the animale that was tested

sampletypecode - The sampletype used Grab, CNEG etc. Control samples must be included

matrix - (optional) Whole Sediment, Sediment Water Interface, etc. Be sure to not include Reference Toxicants

labrep - There should be 5 per station, species pair

result - the percentage that survived the test, or had normal development

Examples

SQOUnified(benthic = benthic_sampledata, chem = chem_sampledata, tox = tox_sampledata)


SCCWRP/SQOUnified documentation built on Nov. 3, 2024, 12:54 a.m.