item_rm_recursive: Remove an item completely by recursively removing its child...

View source: R/item_rm.R

item_rm_recursiveR Documentation

Remove an item completely by recursively removing its child items

Description

BEWARE: This completely removes ALL CHILD ITEMS AND THEIR CHILDREN as well as the item itself.

Usage

item_rm_recursive(sb_id, ..., limit)

Arguments

sb_id

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

...

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

Value

TRUE to indicate success

Examples

## Not run: 
# Create an item with nested structure
authenticate_sb()
fname <- "chairs"
folder = folder_create(user_id(), name = fname)
item_create(folder, title='child1')
item_create(folder, title='child2')

item_list_children(folder)

# then delete the whole folder
sbtools:::item_rm_recursive(folder)

## End(Not run)

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