Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export(TADA_BigDataRetrieval)
export(TADA_Boxplot)
export(TADA_CalculateTotalNP)
export(TADA_CharStringRemoveNA)
export(TADA_CheckRequiredFields)
export(TADA_ColorPalette)
export(TADA_ConvertDepthUnits)
export(TADA_ConvertResultUnits)
Expand Down
6 changes: 0 additions & 6 deletions R/DataDiscoveryRetrieval.R
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,6 @@ TADA_DataRetrieval <- function(startDate = "null",
Projects = projects.DR
)

# need to specify this or throws error when trying to bind rows. Temporary fix for larger
# issue where data structure for all columns should be specified.
cols <- names(TADAprofile)

TADAprofile <- TADAprofile %>% dplyr::mutate_at(cols, as.character)

# run TADA_AutoClean function
if (applyautoclean == TRUE) {
print("Data successfully downloaded. Running TADA_AutoClean function.")
Expand Down
8 changes: 5 additions & 3 deletions R/RequiredCols.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ require.cols <- c(

# Result Quality
"MeasureQualifierCode", # required, could be replaced by TADA.MeasureQualifierCode.Def in future mods
"ResultStatusIdentifier",
"TADA.MeasureQualifierCode.Flag", # generated
"TADA.MeasureQualifierCode.Def", # generated, could replace MeasureQualifierCode in future mods
"ResultCommentText",
Expand Down Expand Up @@ -181,8 +182,7 @@ require.cols <- c(
"HUCEightDigitCode",
"MonitoringLocationIdentifier", # required
"TADA.MonitoringLocationIdentifier",

# Groundwater fields
# Groundwater fields, used for auto filtering for assessment use case but should not be required to have in TADA template
"AquiferName", # filter, groundwater
"AquiferTypeName", # filter
"LocalAqfrName", # filter, groundwater
Expand All @@ -195,6 +195,7 @@ require.cols <- c(

# ordered list of non-essential WQP columns that can be removed from df
extra.cols <- c(
# Others
"ActivityDepthAltitudeReferencePointText",
"ActivityEndDate",
"ActivityEndTime.Time",
Expand All @@ -204,7 +205,6 @@ extra.cols <- c(
"SampleAquifer",
"ActivityLocation.LatitudeMeasure",
"ActivityLocation.LongitudeMeasure",
"ResultStatusIdentifier",
"ResultWeightBasisText",
"ResultTemperatureBasisText",
"ResultParticleSizeBasisText",
Expand Down Expand Up @@ -349,6 +349,8 @@ TADA_GetTemplate <- function() {
#' @param .data A dataframe
#'
#' @return Boolean result indicating whether or not the input dataframe contains all of the TADA profile fields.
#'
#' @export
#'
#' @examples
#' \dontrun{
Expand Down
7 changes: 7 additions & 0 deletions R/Utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ VATribeUrl <- "https://geopub.epa.gov/arcgis/rest/services/EMEF/Tribal/MapServer
#' }
#'
TADA_AutoClean <- function(.data) {
# need to specify this or throws error when trying to bind rows. Temporary fix for larger
# issue where data structure for all columns should be specified.
cols <- names(.data)
.data <- .data %>% dplyr::mutate_at(cols, as.character)

# check .data is data.frame
TADA_CheckType(.data, "data.frame", "Input object")

Expand All @@ -217,6 +222,8 @@ TADA_AutoClean <- function(.data) {
TADA_CheckColumns(.data, required_cols)

# execute function after checks are passed



# check to make sure columns do not already exist and capitalize fields with known synonyms that
# only differ in caps
Expand Down
Loading