item_get_fields: Retrieve specific fields from an SB item

Description Usage Arguments Value Examples

View source: R/item_get_fields.R

Description

Retrieve specific fields from an SB item

Usage

1
2
item_get_fields(sb_id, fields, ..., drop = TRUE,
  session = current_session())

Arguments

sb_id

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

fields

a vector of fields

...

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

drop

logical. If only one field is selected, should the list format be dropped?

session

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

Value

List serialization of chosen metadata for an SB item

Examples

1
2
3
4
5
6
7
8
9
# Get certain fields from an item
item_get_fields("4f4e4b24e4b07f02db6aea14", c('title', 'citation', 'contacts'))

## Not run: 
# If only 1 field selection, do or don't drop list format
item_get_fields("4f4e4b24e4b07f02db6aea14", 'title')
item_get_fields("4f4e4b24e4b07f02db6aea14", 'title', drop = FALSE)

## End(Not run)

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