Learn R Programming

osfr (version 0.2.3)

osf_retrieve: Retrieve an entity from OSF

Description

Create an osf_tbl for an existing OSF project, component, file, or user based on the associated unique identifier. Usually this is a 5-character global unique identifier (GUID) but for files or directories, it could also be a 24-character Waterbutler ID.

Usage

osf_retrieve_user(id)

osf_retrieve_node(id)

osf_retrieve_file(id)

Arguments

id

An OSF identifier corresponding to an OSF user, project, component, or file. Set id = "me" to retrieve your own OSF profile.

Value

An osf_tbl_user, osf_tbl_node, or osf_tbl_file containing the corresponding OSF entity.

A note on 3rd-party storage providers

While OSF supports integration with a variety of 3rd-party cloud storage providers, osfr can currently only access files stored on the default OSF storage service. Support for additional storage providers is planned for a future release.

Details

To begin using osfr to interact with resources on OSF you must use one of the following retrieve functions to create an osf_tbl that contains the entity interest. Note the functions are entity-type specific, use:

  • osf_retrieve_node() to retrieve a project or component

  • osf_retrieve_file() to retrieve a file or directory

  • osf_retrieve_user() to retrieve a user

Examples

Run this code
# NOT RUN {
 # retrieve your own OSF user profile (must be authenticated, ?osf_auth)
 osf_retrieve_user("me")

# retrieve the Psychology Reproducibility Project (P:RP, osf.io/ezum7)
osf_retrieve_node("ezum7")

# get the first figure from the P:RP
osf_retrieve_file("https://osf.io/7js8c")
# }

Run the code above in your browser using DataLab