OSF is a free and open source web application that provides a space for researchers to collaboratively store, manage, and share their research materials (e.g. data, code, protocols).
We are going to use the R package osfr to access data from the following osf project
Ferrer-Paris, J. R. (2023, November 15). Lista Roja de Ecosistemas de UICN de los bosques de las Américas. https://doi.org/10.17605/OSF.IO/M6AFP
4.1 Local folder
First we will create a local folder to keep the data handy for analysis and then we will download the necessary data from different cloud storage services and repositories.
here::i_am("data-preparation/download-osf.qmd")
here() starts at /Users/z3529065/proyectos/Forests-Americas/RLE-example-dry-forest-guajira
See notes on the OSF personal access token (PAT). Only needed for data upload or access to private repos.
Project and components
We use the code of the OSF Project to locate our project and access cloud-based storage bucket where files can be stored and organized into directories.
We can get a list of the components of the parent project:
my_project_components <-osf_ls_nodes(osf_project)
my_project_components
# A tibble: 3 × 3
name id meta
<chr> <chr> <list>
1 Índice de la lista roja de ecosistemas para los bosques de… 4ebrw <named list>
2 Datos espaciales de la evaluación de lista roja de ecosist… wme3b <named list>
3 Resultados de la evaluación de lista roja de ecosistemas d… 57bcv <named list>
Download files from OSF
We can list files under one project or project component using the osf_ls_files function:
osf_ls_files(slice(my_project_components,1))
# A tibble: 0 × 3
# ℹ 3 variables: name <chr>, id <chr>, meta <list>
# A tibble: 4 × 3
name id meta
<chr> <chr> <list>
1 IVC_NS_v7_270m_robin_categories.tif 685e046f512211ea7fd16448 <named list [3]>
2 IVC_NS_v7_270m_robin.tif 685e04727a8d841189d1ade1 <named list [3]>
3 IVC_NS_v7_270m_RLE_results.csv 685e054252d6000545a1c838 <named list [3]>
4 IVC_NS_v7_270m_unit_information.csv 685e05b7439614d89b0704f6 <named list [3]>