Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testdata #142

Merged
merged 10 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Imports:
Depends:
R (>= 3.5.0)
Suggests:
rlang,
remotes,
rlang,
tidyverse,
knitr,
rmarkdown,
Expand Down
34 changes: 33 additions & 1 deletion R/DataDiscoveryRetrieval.R
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,43 @@ autoclean <- function(.data) {

# run MeasureValueSpecialCharacters function
.data <- MeasureValueSpecialCharacters(.data)


#convert 'meters' to 'm'
.data$ActivityDepthHeightMeasure.MeasureUnitCode[.data$ActivityDepthHeightMeasure.MeasureUnitCode == 'meters'] <- 'm'
.data$ActivityTopDepthHeightMeasure.MeasureUnitCode[.data$ActivityTopDepthHeightMeasure.MeasureUnitCode == 'meters'] <- 'm'
.data$ActivityBottomDepthHeightMeasure.MeasureUnitCode[.data$ActivityBottomDepthHeightMeasure.MeasureUnitCode == 'meters'] <- 'm'
.data$ResultDepthHeightMeasure.MeasureUnitCode[.data$ResultDepthHeightMeasure.MeasureUnitCode == 'meters'] <- 'm'
.data$ResultMeasure.MeasureUnitCode[.data$ResultMeasure.MeasureUnitCode == 'meters'] <- 'm'

return(.data)
}


#' autoclean
#'
#' Removes complex biological data. Removes non-water media samples.
#' Removes rows of data that are true duplicates. Capitalizes fields to harmonize
#' data. This function includes and runs the TADA "MeasureValueSpecialCharacters"
#' function as well.
#'
#' Within "BiologicalIntentName", only the allowable values "tissue", "toxicity",
#' and "NA" apply to non-biological data (the function removes all others).
#' Toxicity and fish tissue data will be kept, but other types of biological
#' monitoring data will not.
#'
#' We decided to make some fields uppercase that way they're more compatible
#' with the WQX validation reference tables and to avoid any issues with
#' case-sensitivity when joining data. Therefore, we might need to tack on any
#' immediate QA steps (removing true duplicates, converting result values to numeric,
#' capitalizing letters, etc.) to this function, as well as the other retrieval functions.
#'
#' @param .data TADA dataframe
#'
#' @return cleaned TADA data profile
#'



#' TADA Profile Check
#'
#' This function checks if the column names in a dataframe include the TADA
Expand Down
267 changes: 145 additions & 122 deletions R/ResultFlagsDependent.R

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion R/Transformations.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ WQXTargetUnits <- function(.data, transform = TRUE) {
#' Function generates a harmonization reference table that is specific to
#' the input dataset. Users can review how their input data relates to standard
#' TADA values for CharacteristicName, ResultSampleFractionText,
#' MethodSpecicationName, and ResultMeasure.MeasureUnitCode and they can optionally
#' MethodSpecificationName, and ResultMeasure.MeasureUnitCode and they can optionally
#' edit the reference file to meet their needs.
#'
#' @param .data TADA dataframe
Expand Down
18 changes: 9 additions & 9 deletions docs/articles/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading