Learn R Programming

sbtools (version 1.3.2)

item_rm_recursive: 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)

Value

TRUE to indicate success

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.

Examples

Run this code
if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab