get_sites: A helper to list_sites. Gets site IDS from sciencebase w/...

View source: R/get_sites.R

get_sitesR Documentation

A helper to list_sites. Gets site IDS from sciencebase w/ simple data query

Description

Collects from sciencebase all site names ("site_root" titles, e.g., "nwis_02948375") or the names of sites containing a particular var_src dataset, and returns as a character vector of those site names

Usage

get_sites(with_dataset_name = NULL, with_ts_version = "rds",
  with_ts_archived = FALSE, with_ts_uploaded_after = "2015-01-01",
  limit = 10000)

Arguments

with_dataset_name

limit sites to those with children matching the specified ts or other dataset name (e.g., "ts_doobs_nwis")

with_ts_version

one or more of c('rds','tsv') to limit the dataset extension to anything in with_ts_version (if the dataset is a ts)

with_ts_archived

one or more of c(TRUE,FALSE) to limit the list to sites that have a ts that's archived, not archived, or either

with_ts_uploaded_after

POSIXct, or convertible to POSIXct, giving date after which a ts must have been uploaded to count

limit

integer. the maximum number of items to return

Value

a character vector of "site_root" titles (keys)

Examples

## Not run: 
mda.streams:::get_sites()
mda.streams:::get_sites(limit = 10)
# get those sites that have water temperature in rds, non-archive form
mda.streams:::get_sites(with_dataset_name='ts_disch_nwis', with_ts_version='tsv')
mda.streams:::get_sites(with_dataset_name='ts_doobs_nwis', 
  with_ts_version=c('tsv','rds'), with_ts_archived=TRUE)

## End(Not run)

USGS-R/mda.streams documentation built on June 3, 2023, 8:43 a.m.