Skip to content

Commit

Permalink
warning for duplicates=FALSE with mukey in WHERE clause, update docs …
Browse files Browse the repository at this point in the history
…for fetchNASIS(fill) & fetchSDA_component(duplicates) #121
  • Loading branch information
brownag committed Jan 22, 2020
1 parent e80177d commit b1e713a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions R/get_component_from_SDA.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ get_component_from_SDA <- function(WHERE = NULL, duplicates = FALSE, childs = TR
drop.unused.levels = TRUE,
stringsAsFactors = default.stringsAsFactors()
) {
if(!duplicates & grepl(WHERE, pattern = "mukey"))
warning("duplicates is set to FALSE and 'mukey' is in WHERE clause. Note: 'mukey' omitted from result.", call.=FALSE)

# SDA is missing soiltempa_r AS mast_r
# Joining in the fetch on derived_cokey doesn't work but should. There are duplicate components with the same combination of elements.
Expand Down
2 changes: 1 addition & 1 deletion man/fetchNASIS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ getHzErrorsNASIS(strict=TRUE)
\item{nullFragsAreZero}{should fragment volumes of NULL be interpreted as 0? (default: TRUE), see details}
\item{soilColorState}{which colors should be used to generate the convenience field 'soil_color'? ('moist' | 'dry')}
\item{lab}{should the phlabresults child table be fetched with site/pedon/horizon data (default: FALSE)}
\item{fill}{(fetchNASIS_components only: include components without horizon data? (default: FALSE)}
\item{fill}{(fetchNASIS(from='components') only: include component records without horizon data in result? (default: FALSE)}
\item{strict}{how strict should horizon boundaries be checked for consistency: TRUE=more | FALSE=less}
}

Expand Down
2 changes: 1 addition & 1 deletion man/fetchSDA_component.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ get_cosoilmoist_from_NASIS(impute = TRUE, stringsAsFactors = default.stringsAsFa

\arguments{
\item{WHERE}{text string formated as an SQL WHERE clause (default: FALSE)}
\item{duplicates}{logical; if TRUE duplicate nationalmusym are returned}
\item{duplicates} {logical; if TRUE a record is returned for each unique mukey (may be many per nationalmusym)}
\item{childs}{logical; if FALSE parent material and geomorphic child tables are not flattened and appended}
\item{impute}{replace missing (i.e. NULL) values with "Not_Populated" for categorical data, or the "RV" for numeric data or 201 cm if the "RV" is also NULL (default: TRUE)}
\item{nullFragsAreZero}{should fragment volumes of NULL be interpreted as 0? (default: TRUE), see details}
Expand Down

0 comments on commit b1e713a

Please sign in to comment.