-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- refactor: Shiny tab text updates - miniDOT concatenate - miniDOT reformat - Advanced (new tab) - Formatting Files
- Loading branch information
Showing
24 changed files
with
407 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: ContDataQC | ||
Title: Quality Control (QC) of Continous Monitoring Data | ||
Version: 2.0.7.9015 | ||
Version: 2.0.7.9016 | ||
Authors@R: c( | ||
person("Erik W", "Leppo", email="[email protected]",role=c("aut","cre")), | ||
person("Ann","Roseberry Lincoln", role="ctb"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: "Advanced" | ||
date: "`r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`" | ||
always_allow_html: true | ||
output: | ||
html_fragment: | ||
toc: yes | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(results='asis', echo=FALSE, warning=FALSE, message = FALSE) | ||
# needed for trouble shooting | ||
boo_DEBUG <- FALSE | ||
if(boo_DEBUG==TRUE){ | ||
# myConfig <- file.path(system.file(package="ContDataQC"), "extdata", "config.ORIG.R") | ||
# source(myConfig) | ||
}## IF ~ boo_DEBUG ~ END | ||
``` | ||
# Advanced | ||
|
||
Some users may prefer to use the | ||
<a href="https://github.com/leppott/ContDataQC" target="_blank">R code</a> | ||
instead of the Shiny app. The example code in Figure 1 shows how to run the main | ||
functions when using the default settings in the R package. After the user | ||
directs R to the correct directories and selects the operation (QCRaw, Aggregate | ||
or SummaryStats), there are several places in the code where the user needs to | ||
make entries (e.g., SiteID, sensor type, and start/end date). R will read | ||
through the file names in the directory, select files that match the criteria | ||
and generate outputs for each input file that matches the criteria. | ||
|
||
Users with intermediate to advanced-level R skills can customize the settings | ||
(e.g., add new parameters, change units, change file naming and formatting | ||
requirements, change the format of one of the QC reports from Word to html or | ||
PDF) by editing a plain text [configuration file](Config_default.zip). Users | ||
have more flexibility using the Shiny app versus R package when it comes to | ||
setting directories and file naming schemes because they can browse to the | ||
desired input file(s). | ||
|
||
![Figure 1. Example code from the ContDataQC R package for running the QCRaw function. Entries highlighted in yellow show places where users can modify entries. The other colors show where linkages exist between lines of code, with comments explaining how the R code uses each entry.](RMD_Images/1.6_Fig1_Advanced_20230828.jpg){width=95%} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
inst/shiny-examples/ContDataQC/rmd/App_2a_FormattingFiles.rmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: "Formatting Files" | ||
date: "`r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`" | ||
always_allow_html: true | ||
output: | ||
html_fragment: | ||
toc: yes | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(results='asis', echo=FALSE, warning=FALSE, message = FALSE) | ||
# needed for trouble shooting | ||
boo_DEBUG <- FALSE | ||
if(boo_DEBUG==TRUE){ | ||
# myConfig <- file.path(system.file(package="ContDataQC"), "extdata", "config.ORIG.R") | ||
# source(myConfig) | ||
}## IF ~ boo_DEBUG ~ END | ||
# 20230911, file missing so recreated from Jen's "updates" | ||
``` | ||
|
||
# Formatting Files | ||
|
||
Input files need to be formatted a specific way in order for the Shiny app and R package to work. Guidelines. | ||
|
||
* Input files must be comma-delimited (CSV) (but not CSV UTF-8 files). | ||
|
||
* The columns do not have to be in any specific order | ||
|
||
* There are two required fields: SiteID; and “Date Time” (with Date and Time combined into one field). | ||
|
||
* If using the default [configuration file](Config_default.zip), column names must match the capitalization, spelling and symbology shown in the table below (for example, R will not recognize ‘sensor depth ft’; it needs to be ‘Sensor Depth ft’) | ||
|
||
* Either periods or spaces in the column headings are acceptable. For example, in the table below, air temperature is shown as ‘’Air Temp C’ but it can also be entered as ‘Air.Temp.C’. | ||
|
||
* For units, slashes, spaces or periods (e.g., DO mg/L, DO.mg.L or DO mg L) are acceptable. Do NOT use parentheses. | ||
|
||
* Advanced R users can add new parameters (beyond the ones show in the table below) to the configuration file. | ||
|
||
* Optional fields include rowID, logger ID (serial number) and discrete measurements. Discrete (in situ) measurements can be entered for any parameter (just add ‘Discrete’ to the beginning of the column heading; for example, ‘Discrete Air Temp C’). The discrete data point will be included in the time series plots that are generated when the user runs the QC function. If using Onset HOBO sensors, you can save time by using the automated reformat function | ||
|
||
|
||
## Data Formattting Information | ||
|
||
```{r table_1} | ||
library(readxl) | ||
library(knitr) | ||
library(kableExtra) | ||
# state directories | ||
table.dir <- "tables" | ||
table.file <- "App_Information_Tables.xlsx" | ||
tab2a.dir <- "DataPrep_Table2c" | ||
table2c <- read_excel(file.path(table.dir, table.file), sheet = tab2a.dir | ||
, na = c("NA", ""), trim_ws = TRUE, skip = 0 | ||
, col_names = TRUE) | ||
options(knitr.kable.NA = '') | ||
# kable(table1) | ||
table2c %>% | ||
kbl() %>% | ||
kable_styling(full_width = F, position = "left") | ||
``` |
28 changes: 28 additions & 0 deletions
28
inst/shiny-examples/ContDataQC/rmd/App_2cz_DiscreteData.rmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: "Discrete Data" | ||
date: "`r format(Sys.time(), '%Y-%m-%d %H:%M:%S')`" | ||
always_allow_html: true | ||
output: | ||
html_fragment: | ||
toc: yes | ||
--- | ||
|
||
```{r setup, include=FALSE} | ||
knitr::opts_chunk$set(results='asis', echo=FALSE, warning=FALSE, message = FALSE) | ||
# needed for trouble shooting | ||
boo_DEBUG <- FALSE | ||
if(boo_DEBUG==TRUE){ | ||
# myConfig <- file.path(system.file(package="ContDataQC"), "extdata", "config.ORIG.R") | ||
# source(myConfig) | ||
}## IF ~ boo_DEBUG ~ END | ||
# 20230911, new tab from Jen's "updates" | ||
``` | ||
|
||
# Discrete Data | ||
|
||
Discrete (in situ) measurements can be entered for any parameter. This needs to be done manually after the input file has been formatted (for example, after a HOBO file has been run through the Reformat function). Just add a new column into the input file and use the following naming scheme for the column heading: parameter name and units, with ‘Discrete’ at the beginning (for example, ‘Discrete Air Temp C’). The discrete data point(s) will be included in the time series plots in the Word or html QC reports that are generated when the user runs the QC function (below is an example). | ||
|
||
Discrete measurements are important for validating your data, and in some cases, can be used to correct for sensor drift. Accuracy checks are comparisons of discrete or in situ measurements taken in the lab and/or in the field with sensor measurements from the closest date/time. The sensor measurement should be within the accuracy quoted by the manufacturer (e.g., ±0.2°C if you are using the Onset HOBO proV2 sensor). Click [configuration file](EXAMPLE_AccuracyCheckWkst.xlsx) to download an example of an accuracy check worksheet being kept by an RMN partner. | ||
|
||
![Example QC plot with discrete data](RMD_Images/2.3_Discrete_Fig1_20230828.jpg) |
Oops, something went wrong.