fs_delete: Delete article (private or drafts only) or attached file

View source: R/fs_delete.R

fs_deleteR Documentation

Delete article (private or drafts only) or attached file

Description

Delete article (private or drafts only) or attached file

Usage

fs_delete(article_id, file_id = NULL, session = fs_get_auth(), debug = FALSE)

Arguments

article_id

the id number of the article

file_id

the id number of the file, if removing an attached file from a fileset. file_id defaults to NULL, removing the entire draft or private article.

session

(optional) the authentication credentials from fs_auth. If not provided, will attempt to load from cache as long as figshare_auth has been run.

debug

display return value of request?

Value

output of DELETE request (invisibly)

Author(s)

Carl Boettiger cboettig@gmail.com

References

http://api.figshare.com

See Also

fs_auth

Examples

## Not run: 
fs_delete(123)

## Delete all attachments in the second-most-recent entry in my library
my_lib <- fs_browse(mine=TRUE)
article_id <- my_lib[[2]]$article_id
file_ids <- sapply(my_lib[[2]]$files, `[[`, "id")
sapply(file_ids, function(id) fs_delete(article_id, id))

## End(Not run)

ropensci/rfigshare documentation built on May 18, 2022, 6:34 p.m.