procDERM: Process water quality data from Miami-Dade Department of...

View source: R/derm_wq.R

procDERMR Documentation

Process water quality data from Miami-Dade Department of Environmental Resources Management

Description

Processes DERM data to facilitate analysis and integration with DataForEver data. Adjusts parameter names and units to match DataForEver.

Usage

procDERM(filename = "/opt/physical/troy/RDATA/biscayne/data/data_BBWQall_20180517.txt",
remove_QC_codes = c("B|H|J|K|Q|Y|\\?|\\*"), 
new_names = c("stn", "date", "time", "param", "method", "units", 
"QCcode", "mdl", "value", "dilution.factor", "depth", "depth.code", 
"x", "y", "matrix", "labComments", "project", "genComments", "lab", 
"year", "mo", "day", "datetime"))

Arguments

filename

a character vector file address for DERM data, saved as a tab-delimited text file.

remove_QC_codes

Quality control codes to remove from the dataset.

new_names

names of columns in output (changing this is not recommended)

Details

This function is tailored specifically for DERM datasets.

Value

dataframe procDERM returns a dataframe with water quality measurements, with parameter names and units that match DataForEver data.

See Also

none

Examples

## Not run: 
a <- procDERM()
head(a)

### merge two DERM datasets, keeping duplicates that appear in the more recent dataset
b <- procDERM(filename = "/opt/physical/troy/RDATA/biscayne/data/data_DERM_20190401.txt")

a$id <- paste(a$datetime, a$stn, a$param, sep = "-")
b$id <- paste(b$datetime, b$stn, b$param, sep = "-")

bbDat <- rbind(b, a[!a$id %in% b$id, ])

# write.csv(bbDat, file = "/opt/physical/troy/RDATA/biscayne/data_for_Donatto_DERM.csv")


## End(Not run)


troyhill/SFNRC documentation built on Dec. 30, 2024, 4:32 p.m.