Skip to content

Commit

Permalink
v2.0.6.9025
Browse files Browse the repository at this point in the history
2022-06-07

-   fix: Modify config.R for salinity, Issue #138
    -   Update other copies in package
- feature: Begin adding miniDOT to shiny, Issue #141
  • Loading branch information
leppott committed Jun 7, 2022
1 parent 6b1af4e commit 2a39ce6
Show file tree
Hide file tree
Showing 21 changed files with 432 additions and 35 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
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.6.9024
Version: 2.0.6.9025
Authors@R: c(
person("Erik W", "Leppo", email="Erik.Leppo@tetratech.com",role=c("aut","cre")),
person("Ann","Roseberry Lincoln", role="ctb"),
Expand Down
9 changes: 8 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ NEWS-ContDataQC

<!-- NEWS.md is generated from NEWS.Rmd. Please edit that file -->

#> Last Update: 2022-05-31 12:48:48
#> Last Update: 2022-06-07 09:47:51

# Version History

## v2.0.6.9025

2022-06-07

- fix: Modify config.R for salinity, Issue #138
- Update other copies in package

## v2.0.6.9024

2022-05-31
Expand Down
9 changes: 8 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ NEWS-ContDataQC

<!-- NEWS.md is generated from NEWS.Rmd. Please edit that file -->

#> Last Update: 2022-05-31 12:48:48
#> Last Update: 2022-06-07 09:47:51

# Version History

## v2.0.6.9025

2022-06-07

- fix: Modify config.R for salinity, Issue #138
- Update other copies in package

## v2.0.6.9024

2022-05-31
Expand Down
6 changes: 6 additions & 0 deletions NEWS.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ cat(paste0("Last Update: ",Sys.time()))

# Version History

## v2.0.6.9025
2022-06-07

* fix: Modify config.R for salinity, Issue #138
+ Update other copies in package

## v2.0.6.9024
2022-05-31

Expand Down
3 changes: 3 additions & 0 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ ContData.env$myNames.DataFields <- c(ContData.env$myName.WaterTemp
, ContData.env$myName.Turbidity
, ContData.env$myName.Chlorophylla
, ContData.env$myName.WaterLevel
, ContData.env$myName.Salinity
, ContData.env$myName.Discrete.WaterTemp
, ContData.env$myName.Discrete.AirTemp
, ContData.env$myName.Discrete.WaterP
Expand Down Expand Up @@ -323,6 +324,7 @@ ContData.env$myNames.DataFields.Lab <- c(ContData.env$myLab.WaterTemp
, ContData.env$myLab.Turbidity
, ContData.env$myLab.Chlorophylla
, ContData.env$myLab.WaterLevel
, ContData.env$myLab.Salinity
, ContData.env$myLab.Discrete.WaterTemp
, ContData.env$myLab.Discrete.AirTemp
, ContData.env$myLab.Discrete.WaterP
Expand Down Expand Up @@ -365,6 +367,7 @@ ContData.env$myNames.Order <- c(ContData.env$myName.SiteID
, ContData.env$myName.Turbidity
, ContData.env$myName.Chlorophylla
, ContData.env$myName.WaterLevel
, ContData.env$myName.Salinity
, ContData.env$myName.LoggerID.Water
, ContData.env$myName.RowID.Water
, ContData.env$myName.Discrete.WaterTemp
Expand Down
5 changes: 5 additions & 0 deletions data-raw/ProcessFileCopy_Config.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ config.from <- file.path(".", "R", "config.R")
config.to.template <- file.path(".", "inst", "shiny-examples", "ContDataQC"
, "www", "Config_Template.R")
file.copy(config.from, config.to.template, overwrite = TRUE)
#
config.from <- file.path(".", "R", "config.R")
config.to.template <- file.path(".", "inst", "shiny-examples", "ContDataQC"
, "www", "Config_Default.R")
file.copy(config.from, config.to.template, overwrite = TRUE)

# 3. Copy to extdata
config.from <- file.path(".", "R", "config.R")
Expand Down
53 changes: 53 additions & 0 deletions data-raw/ProcessRMD_ShinyHTML.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Create HTML files for use with Shiny app
# Erik.Leppo@tetratech.com
# 2022-06-01
#~~~~~~~~~~~~~~


# Packages
# libary(rmarkdown)

# # Files
# path_rmd <- "data-raw/rmd"
# myFiles <- list.files(path = path_rmd
# , pattern = "^App_.+\\.Rmd$"
# , full.names = TRUE)
# #myFiles <- myFiles[!myFiles %in% "data-raw/RMD/ShinyHTML_About.Rmd"]
#
# # Loop over files
#
#
# # Render as HTML
# path_shiny_www <- file.path("inst", "shiny-examples", "ContDataQC", "www")
#
#
# for(i in myFiles) {
# # file name w/o extension
# #i_fn <- tools::file_path_sans_ext(basename(i))
# # save to HTML
# rmarkdown::render(input = i
# , output_dir = path_shiny_www
# #, output_format = rmarkdown::html_fragment(df_print = "kable")
# )
# }## FOR ~ i
#
# shell.exec(normalizePath(path_shiny_www))

#______________________________
# Knit to HTML manually

path_rmd <- "data-raw/rmd"
path_shiny_www <- file.path("inst", "shiny-examples", "ContDataQC", "www")

# open folder
shell.exec(normalizePath(path_rmd))

# Copy
myFile <- list.files(path = path_rmd
, pattern = "^App_.+\\.html$"
, full.names = TRUE)
file.copy(myFile
, file.path(path_shiny_www, basename(myFile))
, overwrite = TRUE)
# Delete
unlink(myFile)
28 changes: 28 additions & 0 deletions data-raw/rmd/App_2eDataPrep.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "DataPrep_miniDOT_Cat"
output: html_fragment
---
```{r setup, include=FALSE}
# ---
# title: "DataPrep_miniDOT_Cat"
# date: '2022-06-01'
# ---
knitr::opts_chunk$set(echo = FALSE)
```

# miniDOT Concatenate

This function compiles Dissolved Oxygen data files downloaded from PME miniDot
DO loggers. Use if the data where not compiled using the PME java app on the
logger.

All files uploaded will be merged into a single multi-column CSV file.

## Examples

Example images of before and and after performing reformat.

![Raw miniDOT file](miniDOT_1raw.png)


![Concatenated miniDOT file](miniDOT_2cat.png)
43 changes: 43 additions & 0 deletions data-raw/rmd/App_2fDataPrep.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "DataPrep_miniDOT_Reformat"
output: html_fragment
---
```{r setup, include=FALSE}
# ---
# title: "DataPrep_miniDOT_Reformat"
# date: '2022-06-01'
# ---
knitr::opts_chunk$set(echo = FALSE)
```

# miniDOT Reformat

The miniDOT reformat function will convert the concatenated miniDOT file to the standard expected input for use with ContDataQC.

The CSV output of this function should be placed in the Data0_Original folder.

## Instructions

* Click the ‘Browse’ button and select the input file(s). You can run multiple files at once. The status bar will tell you when the upload is complete.

* Click the ‘Reformat miniDOT file(s)’ button; a status bar will appear in the lower right corner.

* After the function is done running, a ‘Download’ button will appear. Click this button.

* Save the zipped file in the Data1_RAW folder

* Your files are now ready to be run through the QC function!

## Common errors -

* DO percent saturation values of all NA. This is caused by the miniDOT cat program when no inputs are provided to calculate DO percent saturation. All NA values will cause no statistics to be generated for this parameter later in the QC process.

## Examples

Example images of before and and after performing reformat.

![Concatenated miniDOT file](miniDOT_2cat.png)


![Reformated miniDOT file](miniDOT_3reformat.png)

Binary file added data-raw/rmd/miniDOT_1raw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data-raw/rmd/miniDOT_2cat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data-raw/rmd/miniDOT_3reformat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions inst/extdata/config.ORIG.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ ContData.env$myNames.DataFields <- c(ContData.env$myName.WaterTemp
, ContData.env$myName.Turbidity
, ContData.env$myName.Chlorophylla
, ContData.env$myName.WaterLevel
, ContData.env$myName.Salinity
, ContData.env$myName.Discrete.WaterTemp
, ContData.env$myName.Discrete.AirTemp
, ContData.env$myName.Discrete.WaterP
Expand Down Expand Up @@ -323,6 +324,7 @@ ContData.env$myNames.DataFields.Lab <- c(ContData.env$myLab.WaterTemp
, ContData.env$myLab.Turbidity
, ContData.env$myLab.Chlorophylla
, ContData.env$myLab.WaterLevel
, ContData.env$myLab.Salinity
, ContData.env$myLab.Discrete.WaterTemp
, ContData.env$myLab.Discrete.AirTemp
, ContData.env$myLab.Discrete.WaterP
Expand Down Expand Up @@ -365,6 +367,7 @@ ContData.env$myNames.Order <- c(ContData.env$myName.SiteID
, ContData.env$myName.Turbidity
, ContData.env$myName.Chlorophylla
, ContData.env$myName.WaterLevel
, ContData.env$myName.Salinity
, ContData.env$myName.LoggerID.Water
, ContData.env$myName.RowID.Water
, ContData.env$myName.Discrete.WaterTemp
Expand Down
54 changes: 53 additions & 1 deletion inst/shiny-examples/ContDataQC/external/tab_2DataPrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,59 @@ function() {
, height = 600, width = 1000)
) ## mainPanel ~ END
)# sidebarLayout~ END
)## tabPanel ~ END
)## tabPanel ~ HOBO ~ END
, tabPanel("miniDOT Concatenate"
, sidebarLayout(
sidebarPanel(
tags$div(title = "Select one miniDOT csv files to upload here"
, fileInput("selectedFiles_miniDOT"
, label = "Choose files"
, multiple = TRUE
, accept = ".csv"
, width = "600px") # same as HOBO
)##tags$div ~ END
#Only shows the "Run operation" button after data are uploaded
,tags$div(title="Click to run selected operation (miniDOT reformat)"
,uiOutput('ui.runProcess_miniDOT')
)# tags$div ~ END
, br()
#Only shows the "Download" button after the process has run
,tags$div(title="Click to download your data"
,uiOutput('ui.downloadData_miniDOT')
)# tags$div ~ END
)# sidebarPanel~ END
, mainPanel(
includeHTML("www/App_2eDataPrep.html")

) ## mainPanel ~ END
)# sidebarLayout~ END
)## tabPanel ~ miniDOT cat ~ END
, tabPanel("miniDOT Reformat"
, sidebarLayout(
sidebarPanel(
tags$div(title = "Select one miniDOT csv files to upload here"
, fileInput("selectedFiles_miniDOT"
, label = "Choose files"
, multiple = TRUE
, accept = ".csv"
, width = "600px") # same as HOBO
)##tags$div ~ END
#Only shows the "Run operation" button after data are uploaded
,tags$div(title="Click to run selected operation (miniDOT reformat)"
,uiOutput('ui.runProcess_miniDOT')
)# tags$div ~ END
, br()
#Only shows the "Download" button after the process has run
,tags$div(title="Click to download your data"
,uiOutput('ui.downloadData_miniDOT')
)# tags$div ~ END
)# sidebarPanel~ END
, mainPanel(
includeHTML("www/App_2fDataPrep.html")

) ## mainPanel ~ END
)# sidebarLayout~ END
)## tabPanel ~ miniDOT reformat ~ END
)## tabsetPanel ~ END
)## mainPanel ~ END
) ## tabPanel ~ Config ~ END
Expand Down
Loading

0 comments on commit 2a39ce6

Please sign in to comment.