
Last chance! 50% off unlimited learning
Sale ends in
Retrieves an item and its metadata from ScienceBase based on its unique ID. Errors if the requested item ID does not exist or access is restricted due to permissions.
item_get(sb_id, ...)
An object of class sbitem
# \donttest{
# Get an item
item_get("4f4e4b24e4b07f02db6aea14")
# Search for item IDs, then pass to item_get
library("httr")
res <- query_items(list(s = "Search", q = "water", format = "json"))
if(inherits(res, "response") && res$status != 404) {
ids <- vapply(httr::content(res)$items, "[[", "", "id")
lapply(ids[1:3], item_get)
}
# }
Run the code above in your browser using DataLab