item_move {sbtools}R Documentation

Move item from one folder to another

Description

Move item from one folder to another

Usage

item_move(sb_id, id_new, ...)

Arguments

sb_id

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

id_new

Folder/item to move id to. A ScienceBase ID or something that can be coerced to a SB item ID by as.sbitem

...

Additional parameters are passed on to GET, POST, HEAD, PUT.

Value

An object of class sbitem. Same as id, but with new parent id

Examples

## Not run: 
# create 1st folder
(fold1 <- folder_create(user_id(), "bear123"))
(res <- item_create(fold1, "item-to-move"))

# create 2nd folder
(fold2 <- folder_create(user_id(), "bear456"))

# move item in 1st folder to 2nd folder
(res2 <- item_move(res, fold2))

# test identical
identical(res2$parentId, fold2$id)

## End(Not run)

[Package sbtools version 1.3.2 Index]