Skip to contents

Search published data

Usage

search_data(
  text,
  VariableName,
  SampleMedium,
  GeneralCategory,
  SiteType,
  TimeSupport,
  starts_before,
  ends_after,
  num_years,
  area,
  boolean = "AND"
)

Arguments

text

(character) Text to search for in dataset titles and abstracts. Datasets matching any exact words or phrase will be returned. Can be a regular expression as used by stringr::str_detect(). Is not case sensitive. Works with boolean.

VariableName

(character) VariableName values to search on. VariableName values are from ODM Controlled Vocabulary.

SampleMedium

(character) SampleMedium values to search on. SampleMedium values are from ODM Controlled Vocabulary.

GeneralCategory

(character) GeneralCategory values to search on. GeneralCategory values are from ODM Controlled Vocabulary.

SiteType

(character) SiteType values to search on. SiteType values are from ODM Controlled Vocabulary.

TimeSupport

(numeric) Maximum TimeSupport value to search on. TimeSupport is analogous frequency of measurements.

starts_before

(date) Maximum start date to filter on.

ends_after

(date) Minimum end date to filter on.

num_years

(numeric) Minimum and maximum number of years sampled the dataset should contain. Any datasets within this range will be returned.

area

(numeric) Bounding coordinates within which the data should originate. Accepted values are in decimal degrees and in the order: North, East, South, West. Any datasets with overlapping areas or contained points will be returned.

boolean

(character) Boolean operator to use when searching text, VariableName, SampleMedium, GeneralCategory, and SiteType. Supported operators are: "AND", "OR". Default is "AND".

Value

(tbl_df, tbl, data.frame) Search results with these fields:

  • source - Source from which the dataset originates. Currently supported are "EDI" and "NEON".

  • id - Identifier of the dataset.

  • title - Title of the dataset.

  • abstract - Abstract of dataset.

  • years - Number of years sampled.

  • url - URL to dataset.

  • source_id - Identifier of source L0 dataset.

  • source_id_url - URL to source L0 dataset.

Examples

if (FALSE) {
# Empty search returns all available datasets
search_data()

# "text" searches titles, descriptions, and abstracts
search_data(text = "barometric")

# "VariableName" searches VariableName values for a match
search_data(VariableName = "Discharge")

# "SampleMedium" searches SampleMedium values for a match
search_data(SampleMedium = "Water")

# "GeneralCategory" searches GeneralCategory values for a match
search_data(GeneralCategory = "Hydrology")

# "SiteType" searches SiteType values for a match
search_data(SiteType = "Stream")

# "TimeSupport" searches TimeSupport values for a match
search_data(TimeSupport = 30)

# "starts_before" and "ends_after" can be used to filter on a time period
search_data(starts_before = '2000-01-01', ends_after = '2010-01-01')

# "num_years" searches the number of years sampled
search_data(num_years = c(10, 20))

# Use any combination of search fields to find the data you're looking for
search_data(
  text = c("stream", "river"),
  VariableName = c("Conductivity", "Discharge"),
  SampleMedium = "water",
  GeneralCategory = "hydrology",
  SiteType = "Stream",
  TimeSupport = 30,
  starts_before = "2010-01-01",
  ends_after = "2015-01-01",
  num_years = c(10, 100),
  area = c(47.1, -86.7, 42.5, -92),
  boolean = "OR")
}