{"id":13857861,"url":"https://github.com/ropensci/osfr","last_synced_at":"2026-02-19T02:33:16.675Z","repository":{"id":39697033,"uuid":"42329785","full_name":"ropensci/osfr","owner":"ropensci","description":"R interface to the Open Science Framework (OSF)","archived":false,"fork":false,"pushed_at":"2024-07-05T13:40:46.000Z","size":1633,"stargazers_count":150,"open_issues_count":25,"forks_count":30,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-02-10T20:54:40.742Z","etag":null,"topics":["open-science","osf","reproducible-research"],"latest_commit_sha":null,"homepage":"https://docs.ropensci.org/osfr","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ropensci.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":"codemeta.json","zenodo":null}},"created_at":"2015-09-11T20:07:19.000Z","updated_at":"2025-12-06T06:43:43.000Z","dependencies_parsed_at":"2024-11-22T15:44:15.399Z","dependency_job_id":null,"html_url":"https://github.com/ropensci/osfr","commit_stats":{"total_commits":1002,"total_committers":20,"mean_commits":50.1,"dds":"0.38522954091816364","last_synced_commit":"c4e3c446730b0b8145da8a920d208dd55ef2a761"},"previous_names":["centerforopenscience/osfr"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/ropensci/osfr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fosfr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fosfr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fosfr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fosfr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ropensci","download_url":"https://codeload.github.com/ropensci/osfr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Fosfr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29601095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T00:59:38.239Z","status":"online","status_checked_at":"2026-02-19T02:00:07.702Z","response_time":117,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["open-science","osf","reproducible-research"],"created_at":"2024-08-05T03:01:49.039Z","updated_at":"2026-02-19T02:33:16.655Z","avatar_url":"https://github.com/ropensci.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\nSys.unsetenv(c(\"OSF_SERVER\", \"OSF_PAT\"))\n```\n\n# osfr \u003ca href=\"https://docs.ropensci.org/osfr/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/osfr)](https://CRAN.R-project.org/package=osfr)\n[![R-CMD-check](https://github.com/ropensci/osfr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/osfr/actions/workflows/R-CMD-check.yaml)\n[![Coverage status](https://codecov.io/gh/ropensci/osfr/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/osfr?branch=master)\n[![](https://badges.ropensci.org/279_status.svg)](https://github.com/ropensci/software-review/issues/279)\n[![JOSS](https://joss.theoj.org/papers/10.21105/joss.02071/status.svg)](https://doi.org/10.21105/joss.02071)\n[![DOI](https://zenodo.org/badge/42329785.svg)](https://zenodo.org/badge/latestdoi/42329785)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\nosfr provides a suite of functions for interacting with the Open Science Framework ([OSF][osf]).\n\n**What is OSF?**\n\n*OSF is a free and [open source][osf-gh] project management repository designed to support researchers across their entire project lifecycle. The service includes unlimited cloud storage and file version history, providing a centralized location for all your research materials that can be kept private, shared with select collaborators, or made publicly available with citable DOIs.*\n\n## Installation\n\nYou can install the current release of osfr from CRAN (*recommended*):\n\n```r\ninstall.packages(\"osfr\")\n```\n\nOr the development version from GitHub with the *remotes* package:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"ropensci/osfr\")\n```\n\n## Usage Examples\n\n*Note: You need to [setup an OSF personal access token (PAT)][auth] to use osfr to manage projects or upload files.*\n\n### Accessing Open Research Materials\n\nMany researchers use OSF to archive and share their work. You can use osfr to explore publicly accessible projects and download the associated files---all you need to get started is the project's URL or GUID (global unique identifier).\n\nEvery user, project, component, and file on OSF is assigned a GUID that is embedded in the corresponding entity's URL. For example, you can access the main OSF project for the *Cancer Reproducibility Project* at \u003chttps://osf.io/e81xl/\u003e. The GUID for this project is `e81xl`.\n\nWe can then use osfr to *retrieve* this project and load it into R by providing the GUID:\n\n```{r message=FALSE}\nlibrary(osfr)\n\ncr_project \u003c- osf_retrieve_node(\"e81xl\")\ncr_project\n```\n\nThis returns an `osf_tbl` object with a single row representing the retrieved project. Let's list the files that have been uploaded to this project.\n\n```{r}\nosf_ls_files(cr_project)\n```\n\nThis returns another `osf_tbl` with 1 row for each of the files and directories in the project. We can examine any of these files directly on OSF with `osf_open()`, which opens the corresponding file's view in your default browser.\n\nThis project contains 2 ***components***: *Replication Studies* and *Data collection and publishing guidelines*. We can list these components with osfr using `osf_ls_nodes()`.\n\n```{r}\nosf_ls_nodes(cr_project)\n```\n\nosfr is compatible with the [pipe operator][magrittr] and [dplyr][], providing a powerful set of tools for working with `osf_tbl`s. Here, we're listing the sub-components nested within the *Replication Studies* component, filtering for a specific study ([*Study 19*](https://osf.io/7zqxp/)) and then listing the files uploaded to that study's component.\n\n```{r message=FALSE}\nlibrary(dplyr)\n\ncr_project %\u003e%\n  osf_ls_nodes() %\u003e%\n  filter(name == \"Replication Studies\") %\u003e%\n  osf_ls_nodes(pattern = \"Study 19\") %\u003e%\n  osf_ls_files()\n```\n\nWe could continue this pattern of exploration and even download local copies of project files using `osf_download()`. Or, if you come across a publication that  directly references a file's OSF URL, you could quickly download it to your project directory by providing the URL or simply the GUID:\n\n```{r}\nosf_retrieve_file(\"https://osf.io/btgx3/\") %\u003e%\n  osf_download()\n```\n\n\n### Managing Projects\n\nYou can use osfr to [create projects][osf-create], [add sub-components][osf-create] or [directories][osf-mkdir], and [upload files][osf-upload]. See [Getting Started][getting-started] to learn more about building projects with osfr, but here is a quick example in which we:\n\n1. Create a new project called *Motor Trend Car Road Tests*\n2. Create a sub-component called *Car Data*\n3. Create a directory named *rawdata*\n4. Upload a file (`mtcars.csv`) to the new directory\n5. Open the uploaded file on OSF\n\n```{r eval=FALSE}\n# create an external data file\nwrite.csv(mtcars, \"mtcars.csv\")\n\nosf_create_project(title = \"Motor Trend Car Road Tests\") %\u003e%\n  osf_create_component(\"Car Data\") %\u003e%\n  osf_mkdir(\"rawdata\") %\u003e%\n  osf_upload(\"mtcars.csv\") %\u003e%\n  osf_open()\n```\n\n![Screenshot of the uploaded file on OSF](man/figures/screen-shot.png)\n\n## Details on `osf_tbls`\n\nThere are 3 main types of OSF entities that osfr can work with:\n\n1. **nodes:** both [projects][help-proj] and [components][help-comp] (i.e., sub-projects) are referred to as nodes\n2. **files:** this includes both files *and* folders stored on OSF\n3. **users:** individuals with OSF accounts\n\nosfr represents these entities within `osf_tbl`s---specialized data frames built on the tibble class that provide useful information about the entities like their `name` and unique `id` for users, and API data in the `meta` column that's necessary for osfr's internal functions. Otherwise, they're just `data.frames` and can be manipulated using standard functions from base R or dplyr.\n\n## Acknowledgments\n\nOSF is developed by the [Center for Open Science][cos] in Charlottesville, VA.\n\nThe original version of osfr was developed by [Chris Chartgerink][chris] and further developed by [Brian Richards][brian] and [Ryan Hafen][ryan]. The current version was developed by [Aaron Wolen][aaron] and is *heavily* inspired by [Jennifer Bryan][jenny] and [Lucy D'Agostino McGowan][lucy]'s excellent [googledrive][] package. Seriously, we borrowed a lot of great ideas from them. Other important resources include [http testing](https://books.ropensci.org/http-testing/) by Scott Chamberlain and [R Packages](https://r-pkgs.org) by Hadley Wickham. Development was also greatly facilitated by OSF's excellent [API documentation][osf-api].\n\nBig thanks to Rusty Speidel for designing our logo and [Tim Errington][tim] for his feedback during development.\n\n## Contributing\n\nCheck out the [Contributing Guidelines][contrib] to get started with osfr development and note that by contributing to this project, you agree to abide by the terms outlined in the [Contributor Code of Conduct][coc].\n\n```{r cleanup, include=FALSE}\nunlink(\"Study_19_Figure_1.pdf\")\n```\n\n[![ropensci_footer](https://ropensci.org/public_images/ropensci_footer.png)](https://ropensci.org)\n\n\u003c!-- links --\u003e\n[osf]: https://osf.io \"Open Science Framework\"\n[cos]: https://www.cos.io \"Center for Open Science\"\n[osf-gh]: https://github.com/CenterForOpenScience/osf.io \"OSF's GitHub Repository\"\n[osf-api]: https://developer.osf.io \"OSF API Documentation\"\n[help]: https://help.osf.io \"OSF Support\"\n[help-proj]: https://help.osf.io/article/383-creating-a-project \"OSF: Create a Project\"\n[help-comp]: https://help.osf.io/article/253-create-components \"OSF: Create a Component\"\n[magrittr]: https://magrittr.tidyverse.org\n[dplyr]: https://dplyr.tidyverse.org\n[googledrive]: https://googledrive.tidyverse.org\n[tibble]: https://tibble.tidyverse.org\n\n[chris]: https://github.com/chartgerink\n[brian]: https://github.com/bgrich\n[ryan]: https://github.com/hafen\n[aaron]: https://github.com/aaronwolen\n[jenny]: https://github.com/jennybc\n[lucy]: https://github.com/lucymcgowan\n[tim]: https://github.com/timerrington\n\n[getting-started]: https://docs.ropensci.org/osfr/articles/getting_started\n[auth]: https://docs.ropensci.org/osfr/articles/auth\n\n[osf-create]: https://docs.ropensci.org/osfr/reference/osf_create\n[osf-mkdir]: https://docs.ropensci.org/osfr/reference/osf_mkdir\n[osf-upload]: https://docs.ropensci.org/osfr/reference/osf_upload\n\n[contrib]: https://github.com/ropensci/osfr/blob/master/.github/CONTRIBUTING.md\n[coc]: https://github.com/ropensci/osfr/blob/master/.github/CODE_OF_CONDUCT.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fosfr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropensci%2Fosfr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Fosfr/lists"}