item_create: Create a new SB item

View source: R/item_create.R

item_createR Documentation

Create a new SB item

Description

Create a new item on ScienceBase with the requested parent and item title. Info can be provided to populate metadata at the time of creation.

Usage

item_create(
  parent_id = user_id(),
  title,
  ...,
  info,
  session = current_session()
)

Arguments

parent_id

An sbitem object or character ScienceBase ID corresponding to the parent item (folder)

title

The title of the new SB item

...

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

info

(optional) list of metadata info for the new item

session

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

Value

An object of class sbitem

Examples

## Not run: 
# Create an item - by default we use your user ID
item_create(title = "testing 123")

# Pass an object of class sbitem
x <- folder_create(user_id(), "foobar456")
item_create(x, "foobar456-item")

## End(Not run)

sbtools documentation built on May 1, 2023, 1:07 a.m.