Learn R Programming

sbtools (version 1.3.2)

item_get_fields: Retrieve specific fields from an SB item

Description

Retrieve specific fields from an SB item

Usage

item_get_fields(sb_id, fields, ..., drop = TRUE)

Value

List serialization of chosen metadata for an SB item

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.

drop

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

Examples

Run this code
# \donttest{
# Get certain fields from an item
item_get_fields("63cb38b2d34e06fef14f40ad", c('title', 'citation', 'contacts'))

#' # If only 1 field selection, do or don't drop list format
item_get_fields("63cb38b2d34e06fef14f40ad", 'title')
item_get_fields("63cb38b2d34e06fef14f40ad", 'title', drop = FALSE)
# }

Run the code above in your browser using DataLab