item_get: Retrieve SB item

Description Usage Arguments Value Examples

View source: R/item_get.R

Description

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.

Usage

1
item_get(sb_id, ..., session = current_session())

Arguments

sb_id

An sbitem object or a character ScienceBase ID corresponding to the item

...

Additional parameters are passed on to GET, POST, HEAD, PUT, or DELETE

session

Session object from authenticate_sb. Defaults to anonymous or last authenticated session

Value

An object of class sbitem

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Get an item
item_get("4f4e4b24e4b07f02db6aea14")

## Not run: 
# Search for item IDs, then pass to item_get
library("httr")
res <- query_items(list(s = "Search", q = "water", format = "json"))
ids <- vapply(httr::content(res)$items, "[[", "", "id")
lapply(ids[1:3], item_get)

## End(Not run)

sbtools documentation built on May 29, 2017, 7:40 p.m.