Skip to content

Commit

Permalink
Fixing roxygen docs for several functions that were incompletely docu…
Browse files Browse the repository at this point in the history
…mented/not exported
  • Loading branch information
brownag committed Jun 10, 2022
1 parent 1b23c8e commit 65343a5
Show file tree
Hide file tree
Showing 26 changed files with 134 additions and 34 deletions.
14 changes: 14 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export(KSSL_VG_model)
export(NASIS)
export(NASISDomainsAsFactor)
export(OSDquery)
export(ROSETTA)
export(SCAN_sensor_metadata)
export(SCAN_site_metadata)
export(SDA_query)
Expand Down Expand Up @@ -38,14 +39,18 @@ export(fetchVegdata)
export(filter_geochem)
export(format_SQL_in_statement)
export(getHzErrorsNASIS)
export(getHzErrorsPedonPC)
export(get_EDIT_ecoclass_by_geoUnit)
export(get_NASIS_fkey_by_name)
export(get_NASIS_pkey_by_name)
export(get_NASIS_pkeyref_by_name)
export(get_NASIS_table_key_by_name)
export(get_NASIS_table_name_by_purpose)
export(get_NOAA_GHCND)
export(get_NOAA_stations_nearXY)
export(get_OSD)
export(get_RMF_from_NASIS_db)
export(get_SDA_coecoclass)
export(get_SDA_cosurfmorph)
export(get_SDA_hydric)
export(get_SDA_interpretation)
Expand All @@ -66,29 +71,37 @@ export(get_component_correlation_data_from_NASIS_db)
export(get_component_data_from_NASIS_db)
export(get_component_diaghz_from_NASIS_db)
export(get_component_esd_data_from_NASIS_db)
export(get_component_from_GDB)
export(get_component_from_SDA)
export(get_component_horizon_data_from_NASIS_db)
export(get_component_otherveg_data_from_NASIS_db)
export(get_component_restrictions_from_NASIS_db)
export(get_concentrations_from_NASIS_db)
export(get_copedon_from_NASIS_db)
export(get_cosoilmoist_from_NASIS)
export(get_cosoilmoist_from_NASISWebReport)
export(get_cosoilmoist_from_SDA)
export(get_cotext_from_NASIS_db)
export(get_extended_data_from_NASIS_db)
export(get_extended_data_from_pedon_db)
export(get_hz_data_from_NASIS_db)
export(get_hz_data_from_pedon_db)
export(get_lablayer_data_from_NASIS_db)
export(get_labpedon_data_from_NASIS_db)
export(get_legend_from_GDB)
export(get_legend_from_NASIS)
export(get_legend_from_SDA)
export(get_lmuaoverlap_from_NASIS)
export(get_lmuaoverlap_from_SDA)
export(get_mapunit_from_GDB)
export(get_mapunit_from_NASIS)
export(get_mapunit_from_SDA)
export(get_mutext_from_NASIS_db)
export(get_phfmp_from_NASIS_db)
export(get_projectmapunit_from_NASIS)
export(get_site_data_from_NASIS_db)
export(get_site_data_from_pedon_db)
export(get_sitesoilmoist_from_NASISWebReport)
export(get_soilseries_from_NASIS)
export(get_text_notes_from_NASIS_db)
export(get_veg_data_from_NASIS_db)
Expand Down Expand Up @@ -119,6 +132,7 @@ export(simplifyArtifactData)
export(simplifyColorData)
export(simplifyFragmentData)
export(summarizeSoilTemperature)
export(taxaExtent)
export(uncode)
export(waterDayYear)
importClassesFrom(aqp,SoilProfileCollection)
Expand Down
19 changes: 8 additions & 11 deletions R/ROSETTA.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@
return(vg.data)
}

# 2020-11-19:
# * NA are handled safely by the API now
# * model selection is automatic when model code = 0
# * work with Todd to determin the optimal request / record count trade-off

# 2021-01-06
# * best model (0) is always used, API no longer accepts `model` as a parameter
# * versions 1,2,3 supported


#' @title Query USDA-ARS ROSETTA Model API
Expand Down Expand Up @@ -164,17 +171,7 @@
#'
#' Zhang, Y., and M.G. Schaap. 2017. Weighted recalibration of the Rosetta pedotransfer model with improved estimates of hydraulic parameter distributions and summary statistics (Rosetta3). Journal of Hydrology 547: 39-53. doi: \doi{10.1016/j.jhydrol.2017.01.004}.
#'
#'

# 2020-11-19:
# * NA are handled safely by the API now
# * model selection is automatic when model code = 0
# * work with Todd to determin the optimal request / record count trade-off

# 2021-01-06
# * best model (0) is always used, API no longer accepts `model` as a parameter
# * versions 1,2,3 supported

#' @export
ROSETTA <- function(x, vars, v = c('1', '2', '3'), include.sd = FALSE, chunkSize = 10000, conf = NULL) {

# check for required packages
Expand Down
4 changes: 4 additions & 0 deletions R/fetchNASISWebReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#' @param droplevels logical: indicating whether to drop unused levels in
#' classifying factors. This is useful when a class has large number of unused
#' classes, which can waste space in tables and figures.
#' @param 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`)
#' @param usiteid character: User Site IDs
#' @return A data.frame or list with the results.
#' @author Stephen Roecker
#' @keywords manip
Expand Down
1 change: 1 addition & 0 deletions R/fetchPedonPC.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' Fetch commonly used site/horizon data from a version 5.x PedonPC database, return as a SoilProfileCollection object.
#' @aliases fetchPedonPC getHzErrorsPedonPC
#' @param dsn The path to a PedonPC version 6.x database
#' @param strict Use "strict" horizon error checking? Default: `TRUE`
#' @return a SoilProfileCollection class object
#' @note This function attempts to do most of the boilerplate work when
#' extracting site/horizon data from a PedonPC or local NASIS database. Pedons
Expand Down
2 changes: 1 addition & 1 deletion R/filter_KSSL.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param prep_code Character vector of prep code(s) to include in result.
#' @param major_element_method Character vector of major element method(s) to include in result.
#' @param trace_element_method Character vector of trace element method(s) to include in result.
#' @return A data.frame, subsetted according to the constraints specified in arguments.
#' @return A data.frame, subset according to the constraints specified in arguments.
#' @author Andrew G. Brown.
#' @rdname filter_geochem
#' @export filter_geochem
Expand Down
4 changes: 2 additions & 2 deletions R/getHzErrorsNASIS.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#' Get logic errors in NASIS Pedon Horizon
#' Get Logic Errors in NASIS/PedonPC Pedon Horizon
#' @param strict how strict should horizon boundaries be checked for
#' consistency: TRUE=more | FALSE=less
#' @param SS fetch data from the currently loaded selected set in NASIS or from
Expand All @@ -8,7 +8,7 @@
#' table structure; default: NULL
#' @return A data.frame containing problematic records with columns:
#' 'peiid','pedon_id','hzdept','hzdepb','hzname'
#' @export getHzErrorsNASIS
#' @export
getHzErrorsNASIS <- function(strict = TRUE, SS = TRUE, dsn = NULL) {

if (!local_NASIS_defined(dsn))
Expand Down
4 changes: 3 additions & 1 deletion R/getHzErrorsPedonPC.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
## TODO: this isn't really needed any more
#' @export
#' @rdname fetchPedonPC
getHzErrorsPedonPC <- function(dsn, strict=TRUE) {

# get data
site_data <- get_site_data_from_pedon_db(dsn)
hz_data <- get_hz_data_from_pedon_db(dsn)

# combine pieces
f <- merge(hz_data, site_data, by='peiid', all.x = TRUE, sort = FALSE)
f <- merge(hz_data, site_data, by = 'peiid', all.x = TRUE, sort = FALSE)

f.test <- aqp::checkHzDepthLogic(f, hzdepths = c('hzdept', 'hzdepb'),
idname = 'pedon_id', fast = TRUE)
Expand Down
3 changes: 2 additions & 1 deletion R/get_NASIS_table_key_by_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#' @examples
#' \dontrun{
#' get_NASIS_table_key_by_name(c("site","phorizon_View_1","not_a_table"))
#' }
#' }#'
#' @export
get_NASIS_table_key_by_name <- function(tables,
keycol = c("all", "fkey", "pkeyref", "pkey")) {

Expand Down
2 changes: 2 additions & 0 deletions R/get_RMF_from_NASIS_db.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @export
#' @rdname fetchNASIS
get_RMF_from_NASIS_db <- function(SS=TRUE, dsn = NULL) {

# RMF
Expand Down
1 change: 1 addition & 0 deletions R/get_SDA_coecoclass.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#' @param not_rated_value Default: `"Not assigned"`
#' @param miscellaneous_areas Include miscellaneous areas (non-soil components)?
#' @param dsn Path to local SQLite database or a DBIConnection object. If `NULL` (default) use Soil Data Access API via `SDA_query()`.
#' @export
get_SDA_coecoclass <- function(method = "None",
areasymbols = NULL, mukeys = NULL, WHERE = NULL,
query_string = FALSE,
Expand Down
11 changes: 7 additions & 4 deletions R/get_component_from_GDB.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @export
#' @rdname fetchGDB
get_component_from_GDB <- function(dsn = "gNATSGO_CONUS.gdb", WHERE = NULL, childs = FALSE, droplevels = TRUE, stringsAsFactors = NULL) {

# check
Expand Down Expand Up @@ -61,8 +63,9 @@ get_component_from_GDB <- function(dsn = "gNATSGO_CONUS.gdb", WHERE = NULL, chil
return(co)
}



#' @export
#' @rdname fetchGDB
#' @param stats Return statistics (number of mapunit keys per legend; number of components, major components per mapunit, total and hydric component percentage)? Default: `FALSE`
get_legend_from_GDB <- function(dsn = "gNATSGO_CONUS.gdb", WHERE = NULL, droplevels = TRUE, stringsAsFactors = NULL, stats = FALSE) {

if (!is.null(WHERE)) {
Expand Down Expand Up @@ -106,8 +109,8 @@ get_legend_from_GDB <- function(dsn = "gNATSGO_CONUS.gdb", WHERE = NULL, droplev

}



#' @export
#' @rdname fetchGDB
get_mapunit_from_GDB <- function(dsn = "gNATSGO_CONUS.gdb", WHERE = NULL, droplevels = TRUE, stringsAsFactors = NULL, stats = FALSE) {

# tests
Expand Down
Empty file removed R/get_component_from_LIMS.R
Empty file.
2 changes: 2 additions & 0 deletions R/get_concentrations_from_NASIS_db.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @export
#' @rdname fetchNASIS
get_concentrations_from_NASIS_db <- function(SS=TRUE, stringsAsFactors = NULL, dsn = NULL) {

if (!missing(stringsAsFactors) && is.logical(stringsAsFactors)) {
Expand Down
5 changes: 4 additions & 1 deletion R/get_cosoilmoist_from_LIMS.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @export
#' @rdname fetchNASISWebReport
get_cosoilmoist_from_NASISWebReport <- function(projectname, impute = TRUE, stringsAsFactors = NULL) {

if (!missing(stringsAsFactors) && is.logical(stringsAsFactors)) {
Expand All @@ -24,7 +26,8 @@ get_cosoilmoist_from_NASISWebReport <- function(projectname, impute = TRUE, stri
return(d.cosoilmoist)
}


#' @export
#' @rdname fetchNASISWebReport
get_sitesoilmoist_from_NASISWebReport <- function(usiteid) {

url <- "https://nasis.sc.egov.usda.gov/NasisReportsWebSite/limsreport.aspx?report_name=get_sitesoilmoist_from_NASISWebReport"
Expand Down
3 changes: 3 additions & 0 deletions R/get_cosoilmoist_from_SDA.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#' @export
#' @rdname fetchSDA
#' @param impute replace missing (i.e. `NULL`) values with `"Not_Populated"` forcategorical data, or the "RV" for numeric data or `201` cm if the "RV" is also`NULL` (default: `TRUE`)
get_cosoilmoist_from_SDA <- function(WHERE = NULL, duplicates = FALSE, impute = TRUE,
stringsAsFactors = NULL
) {
Expand Down
2 changes: 2 additions & 0 deletions R/get_phfmp_from_NASIS_db.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @export
#' @rdname fetchNASIS
get_phfmp_from_NASIS_db <- function(SS = TRUE, stringsAsFactors = NULL, dsn = NULL) {

if (!missing(stringsAsFactors) && is.logical(stringsAsFactors)) {
Expand Down
2 changes: 1 addition & 1 deletion R/taxaExtent.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
#' }
#'
#' }
#'
#' @export
taxaExtent <- function(x, level = c('order', 'suborder', 'greatgroup', 'subgroup'), formativeElement = FALSE, timeout = 60) {

## sanity checks
Expand Down
32 changes: 29 additions & 3 deletions man/fetchGDB.Rd

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

13 changes: 12 additions & 1 deletion man/fetchNASIS.Rd

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

17 changes: 16 additions & 1 deletion man/fetchNASISWebReport.Rd

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

6 changes: 5 additions & 1 deletion man/fetchPedonPC.Rd

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

Loading

0 comments on commit 65343a5

Please sign in to comment.