osfr

osfr: An R Interface to the Open Science Framework - Published in JOSS (2020)

https://github.com/ropensci/osfr

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    3 of 18 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

open-science osf reproducible-research
Last synced: 4 months ago · JSON representation

Repository

R interface to the Open Science Framework (OSF)

Basic Info
Statistics
  • Stars: 151
  • Watchers: 15
  • Forks: 30
  • Open Issues: 24
  • Releases: 13
Topics
open-science osf reproducible-research
Created over 10 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct Codemeta

README.Rmd

---
output: github_document
---



```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

Sys.unsetenv(c("OSF_SERVER", "OSF_PAT"))
```

# osfr 


[![CRAN status](https://www.r-pkg.org/badges/version/osfr)](https://CRAN.R-project.org/package=osfr)
[![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)
[![Coverage status](https://codecov.io/gh/ropensci/osfr/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/osfr?branch=master)
[![](https://badges.ropensci.org/279_status.svg)](https://github.com/ropensci/software-review/issues/279)
[![JOSS](https://joss.theoj.org/papers/10.21105/joss.02071/status.svg)](https://doi.org/10.21105/joss.02071)
[![DOI](https://zenodo.org/badge/42329785.svg)](https://zenodo.org/badge/latestdoi/42329785)


## Overview

osfr provides a suite of functions for interacting with the Open Science Framework ([OSF][osf]).

**What is OSF?**

*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.*

## Installation

You can install the current release of osfr from CRAN (*recommended*):

```r
install.packages("osfr")
```

Or the development version from GitHub with the *remotes* package:

``` r
# install.packages("remotes")
remotes::install_github("ropensci/osfr")
```

## Usage Examples

*Note: You need to [setup an OSF personal access token (PAT)][auth] to use osfr to manage projects or upload files.*

### Accessing Open Research Materials

Many 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).

Every 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 . The GUID for this project is `e81xl`.

We can then use osfr to *retrieve* this project and load it into R by providing the GUID:

```{r message=FALSE}
library(osfr)

cr_project <- osf_retrieve_node("e81xl")
cr_project
```

This 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.

```{r}
osf_ls_files(cr_project)
```

This 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.

This project contains 2 ***components***: *Replication Studies* and *Data collection and publishing guidelines*. We can list these components with osfr using `osf_ls_nodes()`.

```{r}
osf_ls_nodes(cr_project)
```

osfr 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.

```{r message=FALSE}
library(dplyr)

cr_project %>%
  osf_ls_nodes() %>%
  filter(name == "Replication Studies") %>%
  osf_ls_nodes(pattern = "Study 19") %>%
  osf_ls_files()
```

We 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:

```{r}
osf_retrieve_file("https://osf.io/btgx3/") %>%
  osf_download()
```


### Managing Projects

You 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:

1. Create a new project called *Motor Trend Car Road Tests*
2. Create a sub-component called *Car Data*
3. Create a directory named *rawdata*
4. Upload a file (`mtcars.csv`) to the new directory
5. Open the uploaded file on OSF

```{r eval=FALSE}
# create an external data file
write.csv(mtcars, "mtcars.csv")

osf_create_project(title = "Motor Trend Car Road Tests") %>%
  osf_create_component("Car Data") %>%
  osf_mkdir("rawdata") %>%
  osf_upload("mtcars.csv") %>%
  osf_open()
```

![Screenshot of the uploaded file on OSF](man/figures/screen-shot.png)

## Details on `osf_tbls`

There are 3 main types of OSF entities that osfr can work with:

1. **nodes:** both [projects][help-proj] and [components][help-comp] (i.e., sub-projects) are referred to as nodes
2. **files:** this includes both files *and* folders stored on OSF
3. **users:** individuals with OSF accounts

osfr 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.

## Acknowledgments

OSF is developed by the [Center for Open Science][cos] in Charlottesville, VA.

The 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].

Big thanks to Rusty Speidel for designing our logo and [Tim Errington][tim] for his feedback during development.

## Contributing

Check 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].

```{r cleanup, include=FALSE}
unlink("Study_19_Figure_1.pdf")
```

[![ropensci_footer](https://ropensci.org/public_images/ropensci_footer.png)](https://ropensci.org)


[osf]: https://osf.io "Open Science Framework"
[cos]: https://www.cos.io "Center for Open Science"
[osf-gh]: https://github.com/CenterForOpenScience/osf.io "OSF's GitHub Repository"
[osf-api]: https://developer.osf.io "OSF API Documentation"
[help]: https://help.osf.io "OSF Support"
[help-proj]: https://help.osf.io/article/383-creating-a-project "OSF: Create a Project"
[help-comp]: https://help.osf.io/article/253-create-components "OSF: Create a Component"
[magrittr]: https://magrittr.tidyverse.org
[dplyr]: https://dplyr.tidyverse.org
[googledrive]: https://googledrive.tidyverse.org
[tibble]: https://tibble.tidyverse.org

[chris]: https://github.com/chartgerink
[brian]: https://github.com/bgrich
[ryan]: https://github.com/hafen
[aaron]: https://github.com/aaronwolen
[jenny]: https://github.com/jennybc
[lucy]: https://github.com/lucymcgowan
[tim]: https://github.com/timerrington

[getting-started]: https://docs.ropensci.org/osfr/articles/getting_started
[auth]: https://docs.ropensci.org/osfr/articles/auth

[osf-create]: https://docs.ropensci.org/osfr/reference/osf_create
[osf-mkdir]: https://docs.ropensci.org/osfr/reference/osf_mkdir
[osf-upload]: https://docs.ropensci.org/osfr/reference/osf_upload

[contrib]: https://github.com/ropensci/osfr/blob/master/.github/CONTRIBUTING.md
[coc]: https://github.com/ropensci/osfr/blob/master/.github/CODE_OF_CONDUCT.md

Owner

  • Name: rOpenSci
  • Login: ropensci
  • Kind: organization
  • Email: info@ropensci.org
  • Location: Berkeley, CA

JOSS Publication

osfr: An R Interface to the Open Science Framework
Published
February 06, 2020
Volume 5, Issue 46, Page 2071
Authors
Aaron R. Wolen ORCID
Transplant Research Institute, Department of Surgery, University of Tennessee Health Science Center
Chris H.j. Hartgerink ORCID
Liberate Science GmbH
Ryan Hafen
Department of Statistics, Purdue University
Brian G. Richards
Merkle Group Inc.
Courtney K. Soderberg ORCID
Center for Open Science
Timothy P. York ORCID
Data Science Lab, Department of Human and Molecular Genetics, Virginia Commonwealth University
Editor
Kristen Thyng ORCID
Tags
open science reproducible research project management

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "osfr",
  "description": "An interface for interacting with 'OSF' (<https://osf.io>). 'osfr' enables you to access open research materials and data, or create and manage your own private or public projects.",
  "name": "osfr: Interface to the 'Open Science Framework' ('OSF')",
  "relatedLink": [
    "https://docs.ropensci.org/osfr/",
    "https://CRAN.R-project.org/package=osfr"
  ],
  "codeRepository": "https://github.com/ropensci/osfr",
  "issueTracker": "https://github.com/ropensci/osfr/issues",
  "license": "https://spdx.org/licenses/MIT",
  "version": "0.2.9",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.2.0 (2022-04-22)",
  "author": [
    {
      "@type": "Person",
      "givenName": "Aaron",
      "familyName": "Wolen",
      "email": "aaron@wolen.com",
      "@id": "https://orcid.org/0000-0003-2542-2202"
    },
    {
      "@type": "Person",
      "givenName": "Chris",
      "familyName": "Hartgerink",
      "email": "chjh@protonmail.com",
      "@id": "https://orcid.org/0000-0003-1050-6809"
    }
  ],
  "contributor": [
    {
      "@type": "Person",
      "givenName": "Timothy",
      "familyName": "York",
      "email": "timothypyork@gmail.com",
      "@id": "https://orcid.org/0000-0003-4068-4286"
    },
    {
      "@type": "Person",
      "givenName": "Ryan",
      "familyName": "Hafen",
      "email": "rhafen@purdue.edu"
    },
    {
      "@type": "Person",
      "givenName": "Brian",
      "familyName": "Richards",
      "email": "brian.g.richards@gmail.com"
    },
    {
      "@type": "Person",
      "givenName": "Courtney",
      "familyName": "Soderberg",
      "email": "courtney@cos.io",
      "@id": "https://orcid.org/0000-0003-1227-7042"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Aaron",
      "familyName": "Wolen",
      "email": "aaron@wolen.com",
      "@id": "https://orcid.org/0000-0003-2542-2202"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "dplyr",
      "name": "dplyr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "logger",
      "name": "logger"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rprojroot",
      "name": "rprojroot"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "brio",
      "name": "brio"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "lintr",
      "name": "lintr",
      "version": ">= 2.0"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "spelling",
      "name": "spelling"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "vcr",
      "name": "vcr",
      "version": ">= 0.5"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "R",
      "name": "R",
      "version": ">= 3.1.0"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "crul",
      "name": "crul",
      "version": ">= 0.7.4"
    },
    "3": {
      "@type": "SoftwareApplication",
      "identifier": "jsonlite",
      "name": "jsonlite"
    },
    "4": {
      "@type": "SoftwareApplication",
      "identifier": "stringi",
      "name": "stringi"
    },
    "5": {
      "@type": "SoftwareApplication",
      "identifier": "purrr",
      "name": "purrr"
    },
    "6": {
      "@type": "SoftwareApplication",
      "identifier": "tibble",
      "name": "tibble",
      "version": ">= 3.0.0"
    },
    "7": {
      "@type": "SoftwareApplication",
      "identifier": "rlang",
      "name": "rlang"
    },
    "8": {
      "@type": "SoftwareApplication",
      "identifier": "fs",
      "name": "fs",
      "version": ">= 1.3.0"
    },
    "9": {
      "@type": "SoftwareApplication",
      "identifier": "memoise",
      "name": "memoise"
    },
    "10": {
      "@type": "SoftwareApplication",
      "identifier": "httr",
      "name": "httr"
    },
    "SystemRequirements": null
  },
  "fileSize": "0KB",
  "citation": [
    {
      "@type": "ScholarlyArticle",
      "datePublished": "2020",
      "author": [
        {
          "@type": "Person",
          "givenName": "Aaron R.",
          "familyName": "Wolen"
        },
        {
          "@type": "Person",
          "givenName": "Chris H.J.",
          "familyName": "Hartgerink"
        },
        {
          "@type": "Person",
          "givenName": "Ryan",
          "familyName": "Hafen"
        },
        {
          "@type": "Person",
          "givenName": "Brian G.",
          "familyName": "Richards"
        },
        {
          "@type": "Person",
          "givenName": "Courtney K.",
          "familyName": "Soderberg"
        },
        {
          "@type": "Person",
          "givenName": "Timothy P.",
          "familyName": "York"
        }
      ],
      "name": "{osfr}: An {R} Interface to the Open Science Framework",
      "identifier": "10.21105/joss.02071",
      "url": "https://doi.org/10.21105/joss.02071",
      "pagination": "2071",
      "@id": "https://doi.org/10.21105/joss.02071",
      "sameAs": "https://doi.org/10.21105/joss.02071",
      "isPartOf": {
        "@type": "PublicationIssue",
        "issueNumber": "46",
        "datePublished": "2020",
        "isPartOf": {
          "@type": [
            "PublicationVolume",
            "Periodical"
          ],
          "volumeNumber": "5",
          "name": "Journal of Open Source Software"
        }
      }
    }
  ],
  "releaseNotes": "https://github.com/ropensci/osfr/blob/master/NEWS.md",
  "readme": "https://github.com/ropensci/osfr/blob/master/README.md",
  "contIntegration": [
    "https://github.com/ropensci/osfr/actions/workflows/R-CMD-check.yaml",
    "https://codecov.io/github/ropensci/osfr?branch=master"
  ],
  "review": {
    "@type": "Review",
    "url": "https://github.com/ropensci/software-review/issues/279",
    "provider": "https://ropensci.org"
  },
  "keywords": [
    "osf",
    "open-science",
    "reproducible-research"
  ]
}

Papers & Mentions

Total mentions: 1

The rodent object-in-context task: A systematic review and meta-analysis of important variables
Last synced: 3 months ago

GitHub Events

Total
  • Issues event: 1
  • Watch event: 7
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 2
Last Year
  • Issues event: 1
  • Watch event: 7
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 2

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 1,003
  • Total Committers: 18
  • Avg Commits per committer: 55.722
  • Development Distribution Score (DDS): 0.386
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Aaron Wolen a****n@w****m 616
Brian Richards b****s@g****m 137
CHJ Hartgerink c****h@p****m 112
CHJ Hartgerink c****k@g****m 68
hafen r****n@g****m 20
csoderberg c****e@g****m 12
Timothy York t****k@g****m 12
VP Nagraj v****j@v****u 5
jcolomb j****b@f****e 5
Tim Errington T****n 4
Maëlle Salmon m****n@y****e 4
McKay Davis m****s@g****m 2
Fred Hasselman f****n@b****l 1
Darío Hereñú m****a@g****m 1
Carl Boettiger c****g@g****m 1
Ben Marwick b****k@h****m 1
J. Hathaway h****j@b****u 1
Patrick Anker p****r@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 68
  • Total pull requests: 37
  • Average time to close issues: 5 months
  • Average time to close pull requests: 12 days
  • Total issue authors: 42
  • Total pull request authors: 10
  • Average comments per issue: 2.46
  • Average comments per pull request: 0.35
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • aaronwolen (8)
  • chartgerink (6)
  • tpyork (3)
  • befriendabacterium (3)
  • davidrast3 (3)
  • eeenilsson (2)
  • jcolomb (2)
  • McKayMDavis (2)
  • bnicenboim (2)
  • mmkamso (2)
  • cjvanlissa (2)
  • tiernanmartin (2)
  • mpjashby (2)
  • Martinclayton (1)
  • muschellij2 (1)
Pull Request Authors
  • aaronwolen (19)
  • bgrich (4)
  • maelle (3)
  • saudiwin (2)
  • csoderberg (2)
  • FredHasselman (2)
  • tpyork (2)
  • kant (1)
  • psanker (1)
  • cboettig (1)
Top Labels
Issue Labels
feature request (9) bug (3) help wanted (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 727 last-month
  • Total docker downloads: 2,289
  • Total dependent packages: 4
    (may contain duplicates)
  • Total dependent repositories: 5
    (may contain duplicates)
  • Total versions: 14
  • Total maintainers: 1
proxy.golang.org: github.com/ropensci/osfr
  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 4 months ago
cran.r-project.org: osfr

Interface to the 'Open Science Framework' ('OSF')

  • Versions: 2
  • Dependent Packages: 4
  • Dependent Repositories: 5
  • Downloads: 727 Last month
  • Docker Downloads: 2,289
Rankings
Forks count: 2.8%
Stargazers count: 3.1%
Average: 10.3%
Docker downloads count: 12.5%
Dependent repos count: 13.2%
Dependent packages count: 13.2%
Downloads: 16.6%
Maintainers (1)
Last synced: 4 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.1.0 depends
  • crul >= 0.7.4 imports
  • fs >= 1.3.0 imports
  • httr * imports
  • jsonlite * imports
  • memoise * imports
  • purrr * imports
  • rlang * imports
  • stringi * imports
  • tibble >= 3.0.0 imports
  • covr * suggests
  • dplyr * suggests
  • knitr * suggests
  • lintr >= 2.0 suggests
  • logger * suggests
  • rmarkdown * suggests
  • rprojroot * suggests
  • spelling * suggests
  • testthat * suggests
  • vcr >= 0.5 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite