osf_rm: Delete an entity from OSF

View source: R/osf_rm.R

osf_rmR Documentation

Delete an entity from OSF

Description

Use osf_rm() to permanently delete a project, component, file or directory from OSF, including any uploaded files, wiki content, or comments contained therein. Because this process is irreversible, osfr will first open the item in your web browser so you can verify what is about to be deleted before proceeding.

If the project or component targeted for deletion contains sub-components, those must be deleted first. Setting recurse = TRUE will attempt to remove the hierarchy of sub-components before deleting the top-level entity.

Note: This functionality is limited to contributors with admin-level permissions.

Usage

osf_rm(x, recurse = FALSE, verbose = FALSE, check = TRUE)

Arguments

x

One of the following:

  • An osf_tbl_node with a single OSF project or component.

  • An osf_tbl_file containing a single directory or file.

recurse

Remove all sub-components before deleting the top-level entity. This only applies when deleting projects or components.

verbose

Logical, indicating whether to print informative messages about interactions with the OSF API (default FALSE).

check

If FALSE deletion will proceed without opening the item or requesting verification—this effectively removes your safety net.

Value

Invisibly returns TRUE if deletion was successful.

See Also

Other OSF file operations: osf_cp(), osf_mkdir(), osf_mv()

Examples

## Not run: 
project <- osf_create_project("My Short-Lived Project")
osf_rm(project)

## End(Not run)


CenterForOpenScience/osfr documentation built on Oct. 3, 2022, 4:29 a.m.