View source: R/npn_data_download.R
npn_download_site_phenometrics | R Documentation |
This function allows for a parameterized search of all site phenometrics records in the USA-NPN database, returning all records as per the search parameters in a data table. Data fetched from NPN services is returned as raw JSON before being channeled into a data table. Optionally results can be directed to an output file in which case raw JSON is converted to CSV and saved to file; in that case, data is also streamed to file which allows for more easily handling of the data if the search otherwise returns more data than can be handled at once in memory.
npn_download_site_phenometrics(
request_source,
years,
period_start = "01-01",
period_end = "12-31",
num_days_quality_filter = "30",
coords = NULL,
species_ids = NULL,
genus_ids = NULL,
family_ids = NULL,
order_ids = NULL,
class_ids = NULL,
pheno_class_ids = NULL,
station_ids = NULL,
species_types = NULL,
network_ids = NULL,
states = NULL,
phenophase_ids = NULL,
functional_types = NULL,
additional_fields = NULL,
climate_data = FALSE,
ip_address = NULL,
dataset_ids = NULL,
email = NULL,
download_path = NULL,
six_leaf_layer = FALSE,
six_bloom_layer = FALSE,
agdd_layer = NULL,
six_sub_model = NULL,
additional_layers = NULL,
taxonomy_aggregate = NULL,
pheno_class_aggregate = NULL,
wkt = NULL
)
request_source |
Required field, character Self-identify who is making requests to the data service. |
years |
Required field, character vector. Specify the years to include
in the search, e.g. |
period_start , period_end |
Character vectors of the form "MM-DD". Used to
determine the period over which phenophase status records are summarized.
For example, to use a "water year" set |
num_days_quality_filter |
Required field, defaults to |
coords |
Numeric vector, used to specify a bounding box as a search
parameter, e.g. |
species_ids |
Integer vector of unique IDs for searching based on
species, e.g. |
genus_ids |
Integer vector of unique IDs for searching based on
taxonomic family, e.g. |
family_ids |
Integer vector of unique IDs for searching based on
taxonomic family, e.g. |
order_ids |
Integer vector of unique IDs for searching based on
taxonomic order, e.g. |
class_ids |
Integer vector of unique IDs for searching based on
taxonomic class, e.g. |
pheno_class_ids |
Integer vector of unique IDs for searching based on
pheno class. Note that if both |
station_ids |
Integer vector of unique IDs for searching based on site
location, e.g. |
species_types |
Character vector of unique species type names for
searching based on species types, e.g. |
network_ids |
Integer vector of unique IDs for searching based on
partner group/network, e.g. |
states |
Character vector of US postal states to be used as search
params, e.g. |
phenophase_ids |
Integer vector of unique IDs for searching based on
phenophase, e.g. |
functional_types |
Character vector of unique functional type names, e.g. 'c("Birds"). |
additional_fields |
Character vector of additional fields to be included
in the search results, e.g. |
climate_data |
Boolean value indicating that all climate variables
should be included in |
ip_address |
Optional field, string. IP Address of user requesting data. Used for generating data reports. |
dataset_ids |
Integer vector of unique IDs for searching based on
dataset, e.g. NEON or GRSM |
email |
Optional field, string. Email of user requesting data. |
download_path |
Character, optional file path to the file for which to output the results. |
six_leaf_layer |
Boolean value when set to |
six_bloom_layer |
Boolean value when set to |
agdd_layer |
Numeric value, accepts |
six_sub_model |
Affects the results of the six layers returned. Can be
used to specify one of three submodels used to calculate the spring index
values. Thus setting this field will change the results of |
additional_layers |
Data frame with first column named |
taxonomy_aggregate |
Boolean value indicating whether to aggregate data
by a taxonomic order higher than species. This will be based on the values
set in |
pheno_class_aggregate |
Boolean value indicating whether to aggregate
data by the pheno class ids as per the |
wkt |
WKT geometry by which filter data. Specifying a valid WKT within the contiguous US will filter data based on the locations which fall within that WKT. |
This data type includes estimates of the overall onset and end of phenophase activity for plant and animal species at a site over a user-defined time period. Each row provides the first and last occurrences of a given phenophase on a given species, beginning with the date of the first observed "yes" phenophase status record and ending with the date of the last observed "yes" record of the user-defined time period. For plant species where multiple individuals are monitored at the site, the date provided for "first yes" is the mean of the first "yes" records for each individual plant at the site, and the date for "last yes" is the mean of the last "yes" records. Note that a phenophase may have ended and restarted during the overall period of its activity at the site. These more fine-scale patterns can be explored in the individual phenometrics data.
Most search parameters are optional, however, users are encouraged to supply
additional search parameters to get results that are easier to work with.
request_source
must be provided. This is a self-identifying string, telling
the service who is asking for the data or from where the request is being
made. It is recommended you provide your name or organization name. If the
call to this function is acting as an intermediary for a client, then you may
also optionally provide a user email and/or IP address for usage data
reporting later.
Additional fields provides the ability to specify additional, non-critical fields to include in the search results. A complete list of additional fields can be found in the NPN service's companion documentation. Metadata on all fields can be found in the following Excel sheet: https://www.usanpn.org/files/metadata/site_phenometrics_datafield_descriptions.xlsx
A tibble of all status records returned as per the search
parameters. If download_path
is specified, the file path is returned
instead.
## Not run:
#Download all saguaro data for 2013 and 2014
npn_download_site_phenometrics(
request_source = "Your Name or Org Here",
years = c(2013, 2014),
species_id = 210,
download_path = "saguaro_data_2013_2014.csv"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.