| Title: | Interface to the 'VegBank' Vegetation Plot Database |
|---|---|
| Description: | Provides a programmatic interface to 'VegBank', the vegetation plot database of the Ecological Society of America's Panel on Vegetation Classification, hosted by the National Center for Ecological Analysis and Synthesis (<https://www.nceas.ucsb.edu>). 'VegBank' contains vegetation plot data, community types recognized by the U.S. National Vegetation Classification and others, and all 'ITIS/USDA' plant taxa along with other taxa recorded in plot records. As a 'VegBank' API client, the 'vegbankr' package currently supports querying and downloading vegetation plot records and other supporting information from the 'VegBank' database, and validating and uploading new data to the 'VegBank' database as well. |
| Authors: | Jim Regetz [aut, cre] (ORCID: <https://orcid.org/0009-0008-2666-6229>), Matthew B. Jones [aut] (ORCID: <https://orcid.org/0000-0003-0077-4738>), Rushiraj Nenuji [aut] (ORCID: <https://orcid.org/0000-0003-4678-5213>), Jeanette Clark [aut] (ORCID: <https://orcid.org/0000-0003-4703-1974>), Maggie Klope [aut] (ORCID: <https://orcid.org/0000-0003-3926-7039>) |
| Maintainer: | Jim Regetz <[email protected]> |
| License: | Apache License (>= 2) | file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-26 10:33:31 UTC |
| Source: | https://github.com/NCEAS/vegbankr |
Takes a data frame of VegBank records, and canonicalizes the column names by converting them to snake_case via a package-provided lookup_table. If any column names in the input data frame are unmatched in the lookup table, these are left unaltered in the output, and a warning message is displayed.
canonicalize_names(target_df, lookup_df)canonicalize_names(target_df, lookup_df)
target_df |
(dataframe) |
lookup_df |
(dataframe) Optional custom names lookup table |
Callers may optionally provide a lookup table
A data frame matching the input data frame, but with canonicalized column names
canonicalize_names(data.frame( stratum_ID = integer(), stratummethodname = character() ))canonicalize_names(data.frame( stratum_ID = integer(), stratummethodname = character() ))
Reports paging details associated with a dataframe produced by querying an VegBank API endpoint with limit/offset-based pagination.
get_page_details(x)get_page_details(x)
x |
Dataframe, presumably returned by a VegBank getter |
Named vector with the following elements, if available (any of these values not attached to the data frame will simply be missing from the returned vector):
count_reported: the full record count reported by the API
offset: the record offset used in the API query
limit: the record limit used in the API query
count_returned: the actual count of returned records
## Not run: parties <- get_all_parties(limit=10, offset=50) get_page_details(parties) ## End(Not run)## Not run: parties <- get_all_parties(limit=10, offset=50) get_page_details(parties) ## End(Not run)
Validate at least one of two columns is present
validate_at_least_one_present(df, col1, col2)validate_at_least_one_present(df, col1, col2)
df |
Data frame to validate |
col1 |
First column name |
col2 |
Second column name |
Logical. TRUE if validation passes, FALSE otherwise
Validate no duplicate values in specified columns
validate_no_duplicates(df, columns)validate_no_duplicates(df, columns)
df |
Data frame to validate |
columns |
Character vector of column names to check |
Logical. TRUE if validation passes, FALSE otherwise
Validate no NULL values in specified columns
validate_no_nulls(df, columns)validate_no_nulls(df, columns)
df |
Data frame to validate |
columns |
Character vector of column names to check |
Logical. TRUE if validation passes, FALSE otherwise
Validate values exist in parent table
validate_values_exist( child_df, child_col, parent_df, parent_col, optional = FALSE )validate_values_exist( child_df, child_col, parent_df, parent_col, optional = FALSE )
child_df |
Child data frame |
child_col |
Column name in child data frame |
parent_df |
Parent data frame |
parent_col |
Column name in parent data frame |
optional |
(Boolean) If FALSE, check will fail if parent column is not found. Otherwise, check will skip. |
Logical. TRUE if validation passes, FALSE otherwise
Decodes the exp claim from the stored JWT access token and returns
TRUE if the token exists and has a valid expiry.
vb_access_token_is_valid()vb_access_token_is_valid()
Logical TRUE if the access token is present and valid,
FALSE otherwise.
vb_set_token(), vb_refresh_tokens()
## Not run: vb_access_token_is_valid() ## End(Not run)## Not run: vb_access_token_is_valid() ## End(Not run)
vb_count() and friends (implemented for each of the VegBank
resource types) are used to retrieve a record count from the VegBank
API, optionally constrained by filtering query parameters. The count
is the same as the count_reported attribute attached to API data
responses (see get_page_details()), but is returned here without
actually querying for any data.
vb_count(resource, ...) vb_count_community_classifications(...) vb_count_community_concepts(...) vb_count_cover_methods(...) vb_count_named_places(...) vb_count_parties(...) vb_count_plant_concepts(...) vb_count_plot_observations(...) vb_count_projects(...) vb_count_references(...) vb_count_roles(...) vb_count_stem_counts(...) vb_count_taxon_importances(...) vb_count_strata(...) vb_count_stratum_methods(...) vb_count_taxon_observations(...) vb_count_user_datasets(...)vb_count(resource, ...) vb_count_community_classifications(...) vb_count_community_concepts(...) vb_count_cover_methods(...) vb_count_named_places(...) vb_count_parties(...) vb_count_plant_concepts(...) vb_count_plot_observations(...) vb_count_projects(...) vb_count_references(...) vb_count_roles(...) vb_count_stem_counts(...) vb_count_taxon_importances(...) vb_count_strata(...) vb_count_stratum_methods(...) vb_count_taxon_observations(...) vb_count_user_datasets(...)
resource |
VegBank API resource (e.g., |
... |
Additional API query parameters |
Integer count, or NULL if the count cannot be retrieved
## Not run: vb_count("projects") vb_count_projects(search="california") ## End(Not run)## Not run: vb_count("projects") vb_count_projects(search="california") ## End(Not run)
Use the VegBank API to create a user dataset, which defines a collection of plot observations that can be cited in VegBank.
vb_create_dataset(name, description, observations, dry_run = FALSE)vb_create_dataset(name, description, observations, dry_run = FALSE)
name |
A single character string giving the dataset name. Must be 100 characters or fewer. |
description |
A single character string describing the dataset. |
observations |
A character vector of observation codes. Each element
must match the pattern |
dry_run |
Logical indicating whether to perform a dry run. If |
The processed response object from the VegBank API documenting what (if anything) was successfully created in VegBank.
## Not run: vb_create_dataset( name = "Test Dataset 001", description = "A test dataset containing 10 observations", observations = paste0("ob.", 2948:2957) ) ## End(Not run)## Not run: vb_create_dataset( name = "Test Dataset 001", description = "A test dataset containing 10 observations", observations = paste0("ob.", 2948:2957) ) ## End(Not run)
Set VegBank debug level used to send API requests. This
currently controls two things:
Verbosity of API requests, specifically as handled by
httr::req_perform()
Reporting of the elapsed time, as a console message
vb_debug(verbosity = 1)vb_debug(verbosity = 1)
verbosity |
Integer between 0-3 (Default: 1). Using 0 is
equivalent to setting |
vb_undebug(), httr2::req_perform()
Retrieve data from the VegBank REST API. vb_get() is the core function
that can access any resource type. Resource-specific functions like
vb_get_plot_observations() and vb_get_plant_concepts() are convenience
wrappers that provide resource-appropriate defaults. For typical usage, the
resource-specific functions should be preferred, but vb_get() may be useful
when using vegbankr in a R package or leveraging any experimental VegBank
read API features that may not (yet) supported by vegbankr.
vb_get_projects( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, sort = NULL, ... ) vb_get_parties( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, sort = NULL, ... ) vb_get_roles(vb_code = NULL, limit = 100, offset = 0, parquet = NULL, ...) vb_get_references( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, sort = NULL, ... ) vb_get_named_places( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, ... ) vb_get_cover_methods( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, with_nested = NULL, ... ) vb_get_stratum_methods( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, with_nested = NULL, ... ) vb_get_plant_concepts( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, status = NULL, with_nested = NULL, ... ) vb_get_taxon_observations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_taxon_importances( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_stem_counts( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, ... ) vb_get_strata( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, ... ) vb_get_taxon_interpretations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, ... ) vb_get_community_concepts( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, status = NULL, with_nested = NULL, ... ) vb_get_community_classifications( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_community_interpretations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_plot_observations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, status = NULL, detail = NULL, with_nested = NULL, num_taxa = NULL, num_comms = NULL, ... ) vb_get_user_datasets( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, ... ) vb_get( resource, vb_code = NULL, by = NULL, parquet = TRUE, clean_names = FALSE, limit = 100, offset = 0, ... )vb_get_projects( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, sort = NULL, ... ) vb_get_parties( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, sort = NULL, ... ) vb_get_roles(vb_code = NULL, limit = 100, offset = 0, parquet = NULL, ...) vb_get_references( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, sort = NULL, ... ) vb_get_named_places( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, ... ) vb_get_cover_methods( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, with_nested = NULL, ... ) vb_get_stratum_methods( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, with_nested = NULL, ... ) vb_get_plant_concepts( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, status = NULL, with_nested = NULL, ... ) vb_get_taxon_observations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_taxon_importances( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_stem_counts( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, ... ) vb_get_strata( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, ... ) vb_get_taxon_interpretations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, ... ) vb_get_community_concepts( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, status = NULL, with_nested = NULL, ... ) vb_get_community_classifications( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_community_interpretations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, detail = NULL, with_nested = NULL, ... ) vb_get_plot_observations( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, search = NULL, status = NULL, detail = NULL, with_nested = NULL, num_taxa = NULL, num_comms = NULL, ... ) vb_get_user_datasets( vb_code = NULL, limit = 100, offset = 0, parquet = NULL, ... ) vb_get( resource, vb_code = NULL, by = NULL, parquet = TRUE, clean_names = FALSE, limit = 100, offset = 0, ... )
vb_code |
Optional VegBank code to retrieve a specific record. |
limit |
Integer specifying maximum number of records to return.
Default is 100. Set to |
offset |
Integer specifying the offset for pagination. Default is 0.
Set to |
parquet |
Logical indicating whether to request data in Parquet format
instead of JSON. This is transparent to users insofar as data will
be returned as a data frame in either case, but performance may differ
between the two options. If not specified, defaults to |
search |
Optional search string for filtering results based on full-text
search or the resource's vb_code (the latter of which is functionally
equivalent to using the |
sort |
Optional string for sorting results. Prepend with "-" for descending order (e.g., "-obs_count"). Available for:
|
... |
Additional query parameters passed to the API endpoint as key-value pairs. E.g., foo="bar" will add a URL query parameter "?foo=bar" to the API GET request. |
with_nested |
Logical indicating whether to include nested data
structures. All endpoints support |
status |
Optional string for limiting results by status, with default equivalent to 'any' if unset. Available for:
|
detail |
Character string specifying level of detail. All endpoints
support "full" detail. For those that support "minimal" detail, this is the
default for collection queries, otherwise the default is "full". Plot
observations additionally support |
num_taxa |
Available only for plot-observations. Integer
specifying maximum number of taxon observations to return as a nested
array. If not specified, defaults to 5 for collection queries and 5000
for single-record queries. Set to |
num_comms |
Available only for plot-observations. Integer
specifying maximum number of community classifications records to return as
a nested array. If not specified, defaults to 5 for collection queries and
5000 for single-record queries. Set to |
resource |
Available only for |
by |
Available only for |
clean_names |
Available only for |
The vb_get*() family of functions can all be used to perform three types of
queries, which differ in terms of the set of records returned as well as the
default query parameters applied.
vb_get_plot_observations() - Plot observation data
vb_get_community_concepts() - Community concepts (assertions) linked to
community names through usages
vb_get_community_classifications() - Community classification events
wherein one or more community concepts were applied to a plot observation
vb_get_community_interpretations() - Assignments of community names and
authorities (i.e., community concepts) to specific plot observations, as
part of a community classification event
vb_get_plant_concepts() - Plant concepts (assertions) linked to plant
names through usages
vb_get_taxon_observations() - Data provider's determination of taxa
observed on a plot, and the overall cover of those taxa
vb_get_taxon_importances() - Cover/etc, and optionally stem counts,
of taxa observed on a plot, overall and by stratum if so defined
vb_get_stem_counts() - Stem counts of observed taxa, overall and by
stratum if so defined
vb_get_strata() - Defined strata in which taxon importance and/or stem
counts have been recorded within a given plot observation, consistent with
some stratum method
vb_get_taxon_interpretations() - Assignments of taxon names and
authorities (i.e., plant concepts) to specific taxon observations
vb_get_cover_methods() - Information about registered coverclass methods
vb_get_stratum_methods() - Information about registered strata sampling
protocols
vb_get_named_places() - Information about named places registered in
VegBank
vb_get_references() - Information about references cited within VegBank
vb_get_projects() - Information about projects established to collect
vegetation plot data
vb_get_parties() - Information about people and organizations who have
contributed to the collection or interpretation of a plot
vb_get_roles() - VegBank-defined role types, which can be used to define
the role of a party contributing to a plot observation, classification, etc
vb_get_user_datasets() - Information about people and organizations who have
contributed to the collection or interpretation of a plot
A query is considered a "single-record query" if a vb_code is provided with
prefix that matches the type of the target resource. For example,
vb_get_plot_observations("ob.2948") will return the single VegBank plot
observation record corresponding to "ob.2948", if one exists.
A query is considered a "cross-resource collection query" if a vb_code is
provided with prefix matching a resource type that differs from the target
resource. For example, vb_get_plot_observations("pj.340"), will return the
collection of VegBank plot observation records corresponding to project
pj.340, if the project and corresponding plot observations exist.
A query is considered a "full collection query" if no vb_code is provided.
For example, vb_get_plot_observations() will return all plot observations.
Both collection query types are paginated via limit and offset, and can
be further filtered with parameters like search when supported.
Many parameters have "smart defaults" that change based on whether you're
querying a single record or a collection of records. In general,
single-record queries automatically use settings optimized for detailed
individual records (more nested data, higher limits for related entities),
whereas collection queries use leaner settings. For example,
vb_get_plot_observations() uses detail = "minimal" and with_nested = FALSE for collection queries, but detail = "full" and with_nested = TRUE
for single records.
To use the API's own defaults instead of these smart defaults, explicitly
pass NULL for the parameter (e.g., detail = NULL).
A data frame containing the requested VegBank data.
## Not run: # Collection query - uses minimal detail and excludes nested fields plots <- vb_get_plot_observations(limit = 10) # Single record - uses full detail with nested fields plot <- vb_get_plot_observations(vb_code = "ob.12345") # Override defaults explicitly plots <- vb_get_plot_observations(limit = 10, detail = "full", num_taxa = 50) # Use API defaults instead of smart defaults plots <- vb_get_plot_observations(limit = NULL, detail = NULL, num_taxa = NULL) # Get projects (different available parameters) projects <- vb_get_projects(search = "heritage", limit = 20) ## End(Not run)## Not run: # Collection query - uses minimal detail and excludes nested fields plots <- vb_get_plot_observations(limit = 10) # Single record - uses full detail with nested fields plot <- vb_get_plot_observations(vb_code = "ob.12345") # Override defaults explicitly plots <- vb_get_plot_observations(limit = 10, detail = "full", num_taxa = 50) # Use API defaults instead of smart defaults plots <- vb_get_plot_observations(limit = NULL, detail = NULL, num_taxa = NULL) # Get projects (different available parameters) projects <- vb_get_projects(search = "heritage", limit = 20) ## End(Not run)
Gets the base URL for the VegBank API. If previously set by the user,
e.g. via vb_set_base_url(), this will be pulled from the global
option (vegbank.base_api_url). If this option is unset, the package
default value of https://api.vegbank.org will be used.
vb_get_base_url()vb_get_base_url()
A length-one character vector containing the base URL string
Fetches a VegBank resource using any supported identifier. This function first resolves the identifier to determine the resource type and internal code, then retrieves the full resource data.
vb_get_by_id(identifier, ..., verbose = FALSE)vb_get_by_id(identifier, ..., verbose = FALSE)
identifier |
A character string specifying the VegBank identifier. This can be an accession code, DOI, or other supported identifier type. |
... |
Additional query parameters passed to |
verbose |
Logical. If |
A data frame containing the requested resource data. The structure depends on the resource type.
vb_resolve() for identifier resolution details
## Not run: # Retrieve a dataset silently data <- vb_get_by_id("VB.Ob.2948.ACAD143") # Retrieve with informational message data <- vb_get_by_id("VB.Ob.2948.ACAD143", verbose = TRUE) ## End(Not run)## Not run: # Retrieve a dataset silently data <- vb_get_by_id("VB.Ob.2948.ACAD143") # Retrieve with informational message data <- vb_get_by_id("VB.Ob.2948.ACAD143", verbose = TRUE) ## End(Not run)
Gets basic summary stats from VegBank as a list of data frames, including a table of high level counts and a few tables with "top N" (by count) or "latest N" (by upload date) reports.
vb_overview(limit = 5)vb_overview(limit = 5)
limit |
Integer specifying maximum number of records to return
in the "top_n" and "latest_n" tables. Default is 5. Set to |
A list of data frames corresponding to the returned summary tables
## Not run: # Retrieve summary stats stats_list <- vb_overview(limit=5) ## End(Not run)## Not run: # Retrieve summary stats stats_list <- vb_overview(limit=5) ## End(Not run)
Decodes the exp claim from the stored JWT refresh token and returns
TRUE if the token exists and has a valid expiry.
vb_refresh_token_is_valid()vb_refresh_token_is_valid()
Logical TRUE if the refresh token is present and valid,
FALSE otherwise.
vb_set_token(), vb_refresh_tokens()
## Not run: vb_refresh_token_is_valid() ## End(Not run)## Not run: vb_refresh_token_is_valid() ## End(Not run)
Calls the VegBank /refresh endpoint with the currently stored refresh
token to obtain a new access token and refresh token, then stores both
via vb_set_token().
vb_refresh_tokens()vb_refresh_tokens()
vb_set_token(), vb_unset_token()
## Not run: vb_refresh_tokens() ## End(Not run)## Not run: vb_refresh_tokens() ## End(Not run)
Queries the VegBank API to resolve a public identifier (such as an accession code or DOI) to its internal resource details.
vb_resolve(identifier)vb_resolve(identifier)
identifier |
A character string specifying the VegBank identifier to resolve. This can be an accession code (e.g., "VB.Ob.2948.ACAD143") or other supported identifier type. |
A list containing the resolved identifier details with the following components:
The original identifier value provided
Type of identifier (e.g., "accession_code")
VegBank code for the resource
VegBank resource type
## Not run: # Resolve an accession code result <- vb_resolve("VB.Ob.2948.ACAD143") result$vb_code # "ob.2948" ## End(Not run)## Not run: # Resolve an accession code result <- vb_resolve("VB.Ob.2948.ACAD143") result$vb_code # "ob.2948" ## End(Not run)
Sets a global option specifying the base URL for the VegBank API
using the provided vb_base_url string, optionally adding a port as
"http(s)://vb_base_url:port".
vb_set_base_url(vb_base_url, port)vb_set_base_url(vb_base_url, port)
vb_base_url |
(character) The base URL, including protocol and domain |
port |
(numeric) Optional port value |
vb_set_base_url("https://api.vegbank.org") vb_set_base_url("http://localhost", port = 8080)vb_set_base_url("https://api.vegbank.org") vb_set_base_url("http://localhost", port = 8080)
Stores an OAuth2 access token and/or refresh token in global options for use in subsequent authenticated API requests. Use vb_unset_token() to clear previously stored tokens.
vb_set_token(access_token = NULL, refresh_token = NULL, tokens = NULL)vb_set_token(access_token = NULL, refresh_token = NULL, tokens = NULL)
access_token |
(character) Access token string. |
refresh_token |
(character) Refresh token string. |
tokens |
(list | character) Named list or JSON string containing
|
Two input modes are supported — use one or the other, not both:
Individual strings: pass access_token, refresh_token, or both.
Token dict: pass tokens as a named list or JSON string with access_token and/or refresh_token keys.
vb_unset_token(), vb_refresh_tokens()
vb_set_token(access_token = "eyJhbGciOiJIUzI1NiJ9...") vb_set_token(access_token = "eyJ...", refresh_token = "eyJ...") vb_set_token(tokens = list(access_token = "eyJ...", refresh_token = "eyJ...")) vb_set_token(tokens = '{"access_token": "eyJ...", "refresh_token": "eyJ..."}')vb_set_token(access_token = "eyJhbGciOiJIUzI1NiJ9...") vb_set_token(access_token = "eyJ...", refresh_token = "eyJ...") vb_set_token(tokens = list(access_token = "eyJ...", refresh_token = "eyJ...")) vb_set_token(tokens = '{"access_token": "eyJ...", "refresh_token": "eyJ..."}')
Unset VegBank debugging. Equivalent to vb_debug(0).
vb_undebug()vb_undebug()
Removes the OAuth2 access token and refresh token previously stored by
vb_set_token(). After calling this function, subsequent API requests
will be sent without an Authorization: Bearer header.
vb_unset_token()vb_unset_token()
vb_unset_token()vb_unset_token()
Upload data to VegBank via the REST API. vb_upload() is the core
function that can upload to any of the supported POST endpoints.
Resource-specific functions like vb_upload_plot_observations() are
convenience wrappers that apply resource-specific validation. For
typical usage, the resource-specific functions should be preferred.
vb_upload(resource, ..., query_params = NULL, dry_run = FALSE) vb_upload_plot_observations( plot_observations, projects = NULL, parties = NULL, references = NULL, soils = NULL, disturbances = NULL, community_classifications = NULL, strata = NULL, strata_cover_data = NULL, stem_data = NULL, taxon_interpretations = NULL, contributors = NULL, dry_run = FALSE ) vb_upload_plant_concepts( plant_concepts, plant_names = NULL, plant_correlations = NULL, parties = NULL, references = NULL, what_to_deactivate = NULL, dry_run = FALSE ) vb_upload_community_concepts( community_concepts, community_names = NULL, community_correlations = NULL, parties = NULL, references = NULL, what_to_deactivate = NULL, dry_run = FALSE ) vb_upload_taxon_interpretations( taxon_interpretations, parties = NULL, references = NULL, dry_run = FALSE ) vb_upload_community_classifications( community_classifications, parties = NULL, references = NULL, contributors = NULL, dry_run = FALSE ) vb_upload_cover_methods(cover_methods, references = NULL, dry_run = FALSE) vb_upload_stratum_methods(stratum_methods, references = NULL, dry_run = FALSE)vb_upload(resource, ..., query_params = NULL, dry_run = FALSE) vb_upload_plot_observations( plot_observations, projects = NULL, parties = NULL, references = NULL, soils = NULL, disturbances = NULL, community_classifications = NULL, strata = NULL, strata_cover_data = NULL, stem_data = NULL, taxon_interpretations = NULL, contributors = NULL, dry_run = FALSE ) vb_upload_plant_concepts( plant_concepts, plant_names = NULL, plant_correlations = NULL, parties = NULL, references = NULL, what_to_deactivate = NULL, dry_run = FALSE ) vb_upload_community_concepts( community_concepts, community_names = NULL, community_correlations = NULL, parties = NULL, references = NULL, what_to_deactivate = NULL, dry_run = FALSE ) vb_upload_taxon_interpretations( taxon_interpretations, parties = NULL, references = NULL, dry_run = FALSE ) vb_upload_community_classifications( community_classifications, parties = NULL, references = NULL, contributors = NULL, dry_run = FALSE ) vb_upload_cover_methods(cover_methods, references = NULL, dry_run = FALSE) vb_upload_stratum_methods(stratum_methods, references = NULL, dry_run = FALSE)
resource |
Available only for |
... |
Named data frames to upload. Each data frame should correspond to a table expected by the VegBank API for the specified resource. All arguments must be named, and at least one data frame must be provided. |
query_params |
A named list of parameter names and values to pass to the
API as query parameters. For example, |
dry_run |
Logical indicating whether to perform a dry run. If |
plot_observations |
A data frame containing details about plot observations |
projects |
A data frame containing details about new projects |
parties |
A data frame containing details about new parties |
references |
A data frame containing details about new references |
soils |
A data frame containing details about observed soils |
disturbances |
A data frame containing details about observed disturbances |
community_classifications |
A data frame containing community classifications of observed plots |
strata |
A data frame containing details about strata defined for plot observations |
strata_cover_data |
A data frame containing details about plant cover as observed in different strata of a plot |
stem_data |
A data frame containing details about counts and/or other details about stems observed on a plot |
taxon_interpretations |
A data frame containing taxon interpretations of plants observed on a plot |
contributors |
A data frame associating parties with their contributions to plot observations, projects, and/or community classifications |
plant_concepts |
A data frame containing plant concepts as plant names associated with references, along with with status details and taxonomic parents |
plant_names |
A data frame containing plant name usages associated with specific classification systems for new plant concepts |
plant_correlations |
A data frame defining correlations between plant concepts |
what_to_deactivate |
Available only for |
community_concepts |
A data frame containing community concepts as community names associated with references, along with with status details and taxonomic parents |
community_names |
A data frame containing community name usages associated with specific classification systems for new community concepts |
community_correlations |
A data frame defining correlations between community concepts |
cover_methods |
A data frame containing cover methods and their associated component cover indexes |
stratum_methods |
A data frame containing stratum methods and their associated component stratum types |
The vb_upload*() family of functions can all be used to upload data to
VegBank queries, with each one differing in terms of what input dataframes
are expected (and, in some case, required).
vb_upload_plot_observations() - Plot observational data, including
soil and disturbance observations, plant taxon observations and importance
assessments (potentially including stem-level details) within any defined
strata, and both individual plant taxon and overall vegetation community
interpretation.
vb_upload_plant_concepts() - Plant concepts linked to plant names
through usages, with some status designation
vb_upload_community_concepts() - Community concepts linked to community
names through usages, with some status designation
vb_upload_taxon_interpretations() - Re-interpretation of existing
observation), associating them with one or more VegBank plant concepts
vb_upload_community_classifications() - Re-interpretation of existing
VegBank plot observations, associating them with one or more VegBank
community concepts as part of a classification activity
vb_upload_cover_methods() - New cover methods, including all component
cover indexes defined by the method
vb_upload_stratum_methods() - New stratum methods, including all component
stratum types defined by the method
If vb_debug() is enabled, additional debugging details will be reported to
the console, primarily focused on the data being uploaded.
The processed response object from the VegBank API documenting what (if anything) was successfully uploaded to VegBank.
Performs validation checks on VegBank loader tables to ensure data integrity before upload. Validates required fields, uniqueness constraints, and referential integrity between related tables. Prints validation errors and warnings. This validation tool is a first pass at catching errors - full validation is only done at upload.
vb_validate_community_concepts( community_concepts, community_names = NULL, community_correlations = NULL, parties = NULL, references = NULL )vb_validate_community_concepts( community_concepts, community_names = NULL, community_correlations = NULL, parties = NULL, references = NULL )
community_concepts |
A data frame containing community concepts as community names associated with references, along with with status details and taxonomic parents |
community_names |
A data frame containing community name usages associated with specific classification systems for new community concepts |
community_correlations |
A data frame defining correlations between community concepts |
parties |
A data frame containing details about new parties |
references |
A data frame containing details about new references |
A named list with one element per table, each containing a logical value
(TRUE if all validations passed for that table, FALSE otherwise). For example:
list(community_concepts = TRUE, community_names = FALSE, community_correlations = TRUE)
Performs validation checks on VegBank loader tables to ensure data integrity before upload. Validates required fields, uniqueness constraints, and referential integrity between related tables. Prints validation errors and warnings. This validation tool is a first pass at catching errors - full validation is only done at upload.
vb_validate_cover_methods(cover_methods, references = NULL)vb_validate_cover_methods(cover_methods, references = NULL)
cover_methods |
A data frame containing cover methods and their associated component cover indexes |
references |
A data frame containing details about new references |
A named list with one element per table, each containing a logical value
(TRUE if all validations passed for that table, FALSE otherwise). For example:
list(community_concepts = TRUE, community_names = FALSE, community_correlations = TRUE)
Performs validation checks on VegBank loader tables to ensure data integrity before upload. Validates required fields, uniqueness constraints, and referential integrity between related tables. Prints validation errors and warnings. This validation tool is a first pass at catching errors - full validation is only done at upload.
vb_validate_plant_concepts( plant_concepts, plant_names = NULL, plant_correlations = NULL, parties = NULL, references = NULL )vb_validate_plant_concepts( plant_concepts, plant_names = NULL, plant_correlations = NULL, parties = NULL, references = NULL )
plant_concepts |
A data frame containing plant concepts as plant names associated with references, along with with status details and taxonomic parents |
plant_names |
A data frame containing plant name usages associated with specific classification systems for new plant concepts |
plant_correlations |
A data frame defining correlations between plant concepts |
parties |
A data frame containing details about new parties |
references |
A data frame containing details about new references |
A named list with one element per table, each containing a logical value
(TRUE if all validations passed for that table, FALSE otherwise). For example:
list(parties = TRUE, contributors = FALSE, plot_observations = TRUE)
Performs validation checks on VegBank loader tables to ensure data integrity before upload. Validates required fields, uniqueness constraints, and referential integrity between related tables. Prints validation errors and warnings. This validation tool is a first pass at catching errors - full validation is only done at upload.
vb_validate_plot_observations( plot_observations, projects = NULL, parties = NULL, references = NULL, soils = NULL, disturbances = NULL, community_classifications = NULL, strata = NULL, strata_cover_data = NULL, stem_data = NULL, taxon_interpretations = NULL, contributors = NULL )vb_validate_plot_observations( plot_observations, projects = NULL, parties = NULL, references = NULL, soils = NULL, disturbances = NULL, community_classifications = NULL, strata = NULL, strata_cover_data = NULL, stem_data = NULL, taxon_interpretations = NULL, contributors = NULL )
plot_observations |
A data frame containing details about plot observations |
projects |
A data frame containing details about new projects |
parties |
A data frame containing details about new parties |
references |
A data frame containing details about new references |
soils |
A data frame containing details about observed soils |
disturbances |
A data frame containing details about observed disturbances |
community_classifications |
A data frame containing community classifications of observed plots |
strata |
A data frame containing details about strata defined for plot observations |
strata_cover_data |
A data frame containing details about plant cover as observed in different strata of a plot |
stem_data |
A data frame containing details about counts and/or other details about stems observed on a plot |
taxon_interpretations |
A data frame containing taxon interpretations of plants observed on a plot |
contributors |
A data frame associating parties with their contributions to plot observations, projects, and/or community classifications |
A named list with one element per table, each containing a logical value
(TRUE if all validations passed for that table, FALSE otherwise). For example:
list(parties = TRUE, contributors = FALSE, plot_observations = TRUE)
Performs validation checks on VegBank loader tables to ensure data integrity before upload. Validates required fields, uniqueness constraints, and referential integrity between related tables. Prints validation errors and warnings. This validation tool is a first pass at catching errors - full validation is only done at upload.
vb_validate_stratum_methods(stratum_methods, references = NULL)vb_validate_stratum_methods(stratum_methods, references = NULL)
stratum_methods |
A data frame containing stratum methods and their associated component stratum types |
references |
A data frame containing details about new references |
A named list with one element per table, each containing a logical value
(TRUE if all validations passed for that table, FALSE otherwise). For example:
list(community_concepts = TRUE, community_names = FALSE, community_correlations = TRUE)