TADA_SubstituteDeprecatedChars | R Documentation |
This function uses the WQX Characteristic domain table to substitute deprecated (i.e. retired and/or suspect) Characteristic Names with the new name in the TADA.CharacteristicName column. TADA_SubstituteDeprecatedChars is run within TADA_AutoClean, which runs within TADA_DataRetrieval and (if autoclean = TRUE) in TADA_BigDataRetrieval. Therefore, deprecated characteristic names are harmonized to the new name automatically upon data retrieval. TADA_SubstituteDeprecatedChars can also be used by itself on a user supplied dataset that is in the WQX/WQP format, if desired. This solution works for both EPA WQX and USGS NWIS provided data.
TADA_SubstituteDeprecatedChars(.data)
.data |
TADA dataframe |
Enter ?TADA_GetCharacteristicRef() to review a list of all WQX characteristics, the including deprecated names (Char_Flag). This can be used as a crosswalk between the deprecated names (CharacteristicName) and their new names (Comparable.Name).
Input TADA dataframe with substituted characteristic names in TADA.CharacteristicName column. Original columns are unchanged.
## Not run:
# download nutrient data in MT from 2022 and set autoclean = FALSE
df <- TADA_DataRetrieval(
startDate = "2022-01-01",
endDate = "2022-12-31",
characteristicType = "Nutrient",
statecode = "MT",
applyautoclean = FALSE, ask = FALSE
)
df2 <- TADA_SubstituteDeprecatedChars(df)
# in this example, "Inorganic nitrogen (nitrate and nitrite)" is a USGS NWIS
# characteristic that is deprecated and
# "Phosphate-phosphorus***retired***use Total Phosphorus, mixed forms"
# is a deprecated WQX name. Both are are transformed to their new names.
# review characteristic names before and after transformation
unique(df2$CharacteristicName)
unique(df2$TADA.CharacteristicName)
df3 <- TADA_DataRetrieval(
startDate = "2022-01-01", endDate = "2022-12-31",
characteristicType = "Nutrient", statecode = "WY", applyautoclean = FALSE,
ask = FALSE
)
df4 <- TADA_SubstituteDeprecatedChars(df3)
unique(df4$CharacteristicName)
unique(df4$TADA.CharacteristicName)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.