utilMWRsheet {MassWateR} | R Documentation |
Format a list of QC tables for spreadsheet export
Description
Format a list of QC tables for spreadsheet export
Usage
utilMWRsheet(datin, rawdata = TRUE)
Arguments
datin |
list of input QC tables |
rawdata |
logical to include quality control accuracy summaries for raw data, e.g., field blanks, etc. |
Details
The function is used internally with qcMWRreview
to format data quality objective and quality control tables for export into an Excel spreadsheet. These changes are specific to the spreadsheet format and may not reflect the formatting in the Word document produced by qcMWRreview
.
The datin
list is expected to contain the following elements:
-
frecomdat
Data Quality Objectives for frequency and completeness data frame as returned byreadMWRfrecom
-
accdat
Data Quality Objectives for accuracy data frame as returned byreadMWRacc
-
tabfreper
Frequency checks percent table, created withtabMWRfre
-
tabfresum
Frequency checks summary table, created withtabMWRfre
-
tabaccper
Accuracy checks percent table, created withtabMWRacc
-
tabaccsum
Accuracy checks summary table, created withtabMWRacc
-
tabcom
Completeness table, created withtabMWRcom
-
indflddup
Individual accuracy checks table for field duplicates, created withtabMWRacc
, can beNULL
-
indlabdup
Individual accuracy checks table for lab duplicates, created withtabMWRacc
, can beNULL
-
indfldblk
Individual accuracy checks table for field blanks, created withtabMWRacc
, can beNULL
-
indlabblk
Individual accuracy checks table for lab blanks, created withtabMWRacc
, can beNULL
-
indlabins
Individual accuracy checks table for lab spikes and instrument checks, created withtabMWRacc
, can beNULL
Value
A list similar to the input with formatting applied
Examples
# results data path
respth <- system.file('extdata/ExampleResults.xlsx', package = 'MassWateR')
# dqo accuracy data path
accpth <- system.file('extdata/ExampleDQOAccuracy.xlsx', package = 'MassWateR')
# dqo completeness data path
frecompth <- system.file('extdata/ExampleDQOFrequencyCompleteness.xlsx', package = 'MassWateR')
# censored data path
censpth <- system.file('extdata/ExampleCensored.xlsx', package = 'MassWateR')
# results data
resdat <- readMWRresults(respth)
# accuracy data
accdat <- readMWRacc(accpth)
# frequency and completeness data
frecomdat <- readMWRfrecom(frecompth)
# censored data
censdat <- readMWRcens(censpth)
# frequency table percent
tabfreper <- tabMWRfre(res = resdat, acc = accdat, frecom = frecomdat, type = 'percent',
warn = FALSE)
# frequency summary table
tabfresum <- tabMWRfre(res = resdat, acc = accdat, frecom = frecomdat, type = 'summary',
warn = FALSE)
# accuracy table percent
tabaccper <- tabMWRacc(res = resdat, acc = accdat, frecom = frecomdat, type = 'percent',
warn = FALSE)
# accuracy table summary
tabaccsum <- tabMWRacc(res = resdat, acc = accdat, frecom = frecomdat, type = 'summary',
warn = FALSE)
# completeness table
tabcom <- tabMWRcom(res = resdat, frecom = frecomdat, cens = censdat, warn = FALSE,
parameterwd = 1.15, noteswd = 2)
# individual accuracy checks for raw data
indflddup <- tabMWRacc(res = resdat, acc = accdat, frecom = frecomdat, type = 'individual',
accchk = 'Field Duplicates', warn = FALSE, caption = FALSE)
indlabdup <- tabMWRacc(res = resdat, acc = accdat, frecom = frecomdat, type = 'individual',
accchk = 'Lab Duplicates', warn = FALSE, caption = FALSE)
indfldblk <- tabMWRacc(res = resdat, acc = accdat, frecom = frecomdat, type = 'individual',
accchk = 'Field Blanks', warn = FALSE, caption = FALSE)
indlabblk <- tabMWRacc(res = resdat, acc = accdat, frecom = frecomdat, type = 'individual',
accchk = 'Lab Blanks', warn = FALSE, caption = FALSE)
indlabins <- tabMWRacc(res = resdat, acc = accdat, frecom = frecomdat, type = 'individual',
accchk = 'Lab Spikes / Instrument Checks', warn = FALSE, caption = FALSE)
# input
datin <- list(
frecomdat = frecomdat,
accdat = accdat,
tabfreper = tabfreper,
tabfresum = tabfresum,
tabaccper = tabaccper,
tabaccsum = tabaccsum,
tabcom = tabcom,
indflddup = indflddup,
indlabdup = indlabdup,
indfldblk = indfldblk,
indlabblk = indlabblk,
indlabins = indlabins
)
utilMWRsheet(datin)