sbitem: ScienceBase item class

sbitemR Documentation

ScienceBase item class

Description

ScienceBase item class

Usage

as.sbitem(x, ...)

## Default S3 method:
as.sbitem(x, ...)

is.sbitem(x)

Arguments

x

Input, variety of things, character, list, or sbitem class object

...

Further args passed on to item_get, only in the method for character class inputs

Examples


# Single item from item_get()
item_get("57976a0ce4b021cadec97890")

# Get many w/ e.g., an lapply() call
library("httr")
res <- query_items(list(s = "Search", q = "water", format = "json"))
if(res$status == 200) {
  ids <- vapply(httr::content(res)$items, "[[", "", "id")
  (out <- lapply(ids[1:3], item_get))
}
# create item class from only an item ID
as.sbitem("5ebe92af82ce476925e44b8f")

# sbitem gives back itself
(x <- as.sbitem("5ebe92af82ce476925e44b8f"))
as.sbitem(x)


USGS-R/sbtools documentation built on June 1, 2024, 9:47 p.m.