compileNETNdata: compileNETNdata

View source: R/compileNETNdata.R

compileNETNdataR Documentation

compileNETNdata

Description

Compile flat files from NETN Access Database for R package

Usage

compileNETNdata(
  path = "./Data/",
  export = TRUE,
  surface = TRUE,
  active_site = TRUE,
  active_metric = TRUE,
  restricted = TRUE,
  cleanEnv = TRUE
)

Arguments

path

Quoted path to export csv files to. Defaults to "Data" folder within current project.

export

TRUE or FALSE. Export csv files to specified path. Defaults to TRUE.

surface

TRUE or FALSE. Return only measurements representing the stream surface or lake epilimnion. If TRUE, the median of the surface measurements from the top 2m of sampling are returned. Defaults to TRUE.

active_site

TRUE or FALSE. If TRUE only compiles data for sites that are actively being monitored. If FALSE compiles all sites stored in the database. Defaults to TRUE.

active_metric

TRUE or FALSE. If TRUE only compiles metrics that are actively collected. If FALSE compiles all metrics stored in the database. Defaults to TRUE.

restricted

TRUE or FALSE. If TRUE, metrics within a site that have 4 or fewer measurements since monitoring began in 2006 are dropped.

cleanEnv

TRUE or FALSE. Allows you to clean the global environment so that only waterDat and MD are kept. Defaults to TRUE.

Details

This function create flat files from NETN's water database. The function returns 2 data frames used for the NCRNWater R package (Water Data and Meta Data). Currently the Water Data list element can include (1) measurements at all sampled depths (for plotting profiles) AND the the median value of measurements taken within the top 2m of the water surface when surface == FALSE or (2) just the median values of surface measurements within the top 2m of the water surface surface == TRUE. The latter is to enable examining patterns in the stream surface or lake epilimnion over time and is currently (as of 11/1/2019) the data working in the NCRNwater package.

Value

Returns a list of two dataframes (WaterData and MetaData) formatted for import into NCRNwater R package.Exports data to folder by default.

Examples

# compile NETN water data for surface measurements and active metrics only,
# and export to C:/Data.
compileNETNdata(path = "C:/Data/", export = TRUE, surface = TRUE, active = TRUE, 
  restricted = TRUE)


NCRN/NCRNWater documentation built on May 15, 2023, 9:50 p.m.