item_get_fields: Retrieve specific fields from an SB item

View source: R/item_get.R

item_get_fieldsR Documentation

Retrieve specific fields from an SB item

Description

Retrieve specific fields from an SB item

Usage

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

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?

Value

List serialization of chosen metadata for an SB item

Examples


# 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)


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