Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ renv/
~$*.xlsx
*.json
inst/doc
int/credentials/*.json
inst/credentials/
*.csv
L0



19 changes: 14 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ Package: collaboratR
Title: validation and version control for level 0 data using Google Drive
Version: 0.0.0.9100
Authors@R:
person("Patrick", "Bills", , "billspat@msu.edu", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4235-255X"))
c(person("Patrick S.", "Bills", "", "billspat@msu.edu", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4235-255X")),
person("Ashwini", "Ramesh", "", "ashwini.ramesh@yale.edu", role = c("aut","dtc"),
comment = c(ORCID = "0000-0003-1629-7024")),
person("Laís", "Petri", "", "petrila1@msu.edu", role = c("aut", "dtc"),
comment = c(ORCID = "0000-0001-9727-1939")),
person("Phoebe Lehman", "Zarnetske", "", "plz@msu.edu", role = c("aut","fnd"),
comment = c(ORCID = "0000-0001-6257-6951"))
)
Description: Data management for Community Ecology RULES project of MSU IBEEM,
using the EDI data package framework. Reads data entered using from google drive
and validates using standard set of rules.
using the EDI data package framework. Reads data and schema from google drive,
validates using standard set of rules, and combines into CSV.
URL: https://ibeem-msu.github.io/collaboratR, https://github.com/IBEEM-MSU/collaboratR
License: MIT + file LICENSE
Suggests:
knitr,
Expand All @@ -20,10 +28,11 @@ Imports:
gargle,
googledrive,
googlesheets4,
httpuv,
readr,
validate,
dplyr
VignetteBuilder: knitr
Depends:
R (>= 2.10)
R (>= 4.1.0)
LazyData: true
3 changes: 3 additions & 0 deletions R/install_dev_packages.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

dev_packages <- c('devtools', 'pkgdown', 'renv')
install.packages(dev_packages, repos = "https://cran.rstudio.com")
78 changes: 62 additions & 16 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,83 @@ knitr::opts_chunk$set(

# collaboratR

### [MSU IBEEM](https://ibeem.msu.edu) commRULES project
**A package to support collaborative meta-analysis for [MSU IBEEM](https://ibeem.msu.edu)**

### Authors:

- Patrick S Bills
- Ashwini Ramesh
- Laís Petri
- Phoebe Lehman Zarnetske, PI and Director, IBEEM

### Contributors:

- Kelly Kapsar, Data Scientist, IBEEM
- Alejandra Martinez Blancas
- Amar Deep Tiwari

<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/collaboratR)](https://CRAN.R-project.org/package=collaboratR)
<!-- badges: end -->

*This is very early version under heavy development.*
### Motivation

This R package is part of 3 repositories that support the data entry, validation and accumulation of a meta-analysis for the commRULES project.
Performing a Meta-analysis requires collating and harmonizing data extracted
from many different sources but most frequently scientific publications.
Collaborative meta-analysis requires a group of scientists to collectively develop
and agree on their goals, type of data extracted, format of the those data, and to
do so extremely consistently across papers. This package helps to support that
efficiently by the easy-to-use Google Sheets for data definition and data entry.
The workflow in this project can read directly from Google sheets into CSVs and
validate the structure of a google sheet as well as the data using the Validate package.

1. commRULES data: version controlled data collection for tracking provenance using git, this is the L0 and L1 layers in the EDI framework
2. collaboratR: commRULES data management code for L0 and L0->L1 layer in EDI framework
3. commRULES-analysis: R code for reproducible data analysis , L1->L2 layers in EDI framework
<!-- insert description of the EDI data transform framework here -->

## Installation - Package
Originally, this This R package was part of 3 repositories that support the
data entry, validation and accumulation of a meta-analysis for a research project
sponsored by MSU IBEEM


1. collaboratR: data management code for L0 and L0->L1 layer in EDI framework
1. data: version controlled data collection for tracking provenance using git,
this is the L0 and L1 layers in the EDI framework. the collaboratR package
assists with data transfer and validation from Google drive into the data repository.
1. analysis: R code for reproducible data analysis , L1->L2 layers in EDI framework,
using data in the data repository.

This package uses [renv](https://rstudio.github.io/renv/) to manage the packages you need to install, which creates an `renv.lock` file for you.
## Installation - Package

- install RENV: this can go into your R environment used for all packages, so fire up R with now project select and `install.packages('renv')`
- clone this repository into a [new Rstudio project](https://docs.posit.co/ide/user/ide/guide/code/projects.html) and open it
- inside the Rstudio project in the R console, `renv::restore()`

## Google Drive Project Setup
- install required packages:
This package uses [renv](https://rstudio.github.io/renv/) to manage the packages you need to install, which creates an `renv.lock` file for you. 1. install the renv package: this can go into your R environment used for all packages.
2. in R run `renv::restore()` or if that complains about R versions

*additional packages are required to build the package and this website, source the script*
`R/install_dev_packages.R`

### Installation/Testing

Google drive in this package is set to interaction. To run any building, installing or checking in R,
you must first manually connect to google drive, which must be set-up properly first.

See the vignette in this package "Google Sheets API setup using Google Cloud",
or in this source code see [Google Sheets Vignette RMD](vignettes/google_sheets_api.Rmd)

Once set-up you may have to log-in manually prior to running tests or checks,
use

```r
source("R/gdrive.R")

Using google drive via MSU seems to require creating a Google Cloud project, enabling the proper
APIs and and assigning permissions
## Data Google Drive Project Setup

Note that for safety, this package only reads from google drive and it never writes to google drive. Therefore it only requests 'read-only' access.
See the Vignette ["Google Sheets API setup using Google Cloud"](vignettes/google_sheets_api.Rmd)
for details about setting up google sheets connection with R, which requires
a google cloud project in your institution

Full documentation for how to set this up is forthcoming
Note that for safety, this package only reads from google drive and it never
writes to google drive. Therefore it only requests 'read-only' access.

## Usage

Expand Down
117 changes: 96 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,114 @@

# collaboratR

### [MSU IBEEM](https://ibeem.msu.edu) commRULES project
**A package to support collaborative meta-analysis for [MSU
IBEEM](https://ibeem.msu.edu)**

### Authors:

- Patrick S Bills
- Ashwini Ramesh
- Laís Petri
- Phoebe Lehman Zarnetske, PI and Director, IBEEM

### Contributors:

- Kelly Kapsar, Data Scientist, IBEEM
- Alejandra Martinez Blancas
- Amar Deep Tiwari

<!-- badges: start -->

[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN
status](https://www.r-pkg.org/badges/version/collaboratR)](https://CRAN.R-project.org/package=collaboratR)
<!-- badges: end -->

*This is very early version under heavy development.*
### Motivation

This R package is part of 3 repositories that support the data entry,
validation and accumulation of a meta-analysis for the commRULES
project.
Performing a Meta-analysis requires collating and harmonizing data
extracted from many different sources but most frequently scientific
publications.
Collaborative meta-analysis requires a group of scientists to
collectively develop and agree on their goals, type of data extracted,
format of the those data, and to do so extremely consistently across
papers. This package helps to support that efficiently by the
easy-to-use Google Sheets for data definition and data entry. The
workflow in this project can read directly from Google sheets into CSVs
and validate the structure of a google sheet as well as the data using
the Validate package.

1. commRULES data: version controlled data collection for tracking
provenance using git, this is the L0 and L1 layers in the EDI
framework
2. collaboratR: commRULES data management code for L0 and L0-\>L1 layer
in EDI framework
3. commRULES-analysis: R code for reproducible data analysis , L1-\>L2
layers in EDI framework
<!-- insert description of the EDI data transform framework here -->

Originally, this This R package was part of 3 repositories that support
the data entry, validation and accumulation of a meta-analysis for a
research project sponsored by MSU IBEEM

## Installation
1. collaboratR: data management code for L0 and L0-\>L1 layer in EDI
framework
2. data: version controlled data collection for tracking provenance
using git, this is the L0 and L1 layers in the EDI framework. the
collaboratR package assists with data transfer and validation from
Google drive into the data repository.
3. analysis: R code for reproducible data analysis , L1-\>L2 layers in
EDI framework, using data in the data repository.

This package uses [renv](https://rstudio.github.io/renv/) to manage the
packages you need to install, which creates an `renv.lock` file for you.
## Installation - Package

- install RENV: this can go into your R environment used for all
packages, so fire up R with now project select and
`install.packages('renv')`
- clone this repository into a [new Rstudio
project](https://docs.posit.co/ide/user/ide/guide/code/projects.html)
and open it
- inside the Rstudio project in the R console, `renv::restore()`

- install required packages: This package uses
[renv](https://rstudio.github.io/renv/) to manage the packages you
need to install, which creates an `renv.lock` file for you. 1. install
the renv package: this can go into your R environment used for all
packages.

2. in R run `renv::restore()` or if that complains about R versions

*additional packages are required to build the package and this website,
source the script* `R/install_dev_packages.R`

### Installation/Testing

Google drive in this package is set to interaction. To run any building,
installing or checking in R, you must first manually connect to google
drive, which must be set-up properly first.

See the vignette in this package “Google Sheets API setup using Google
Cloud”, or in this source code see [Google Sheets Vignette
RMD](vignettes/google_sheets_api.Rmd)

Once set-up you may have to log-in manually prior to running tests or
checks, use

``` r
source("R/gdrive.R")

## Data Google Drive Project Setup

See the Vignette ["Google Sheets API setup using Google Cloud"](vignettes/google_sheets_api.Rmd)
for details about setting up google sheets connection with R, which requires
a google cloud project in your institution

Note that for safety, this package only reads from google drive and it never
writes to google drive. Therefore it only requests 'read-only' access.

## Usage

When reading in data sheets, you provide a URL for a datasheet that exists in any folder that you have access to. The system will attempt to log you into to google drive and requests your permission for this code to access files on your behalf.

```R
gurl<- 'https://docs.google.com/spreadsheets/d/1w6sYozjybyd53eeiTdigrRTonteQW2KXUNZNmEhQyM8/edit?gid=0#gid=0'
study_data<- read_commrules_sheet(gurl)
```

###

## References

@article{van2021data, title={Data validation infrastructure for R},
author={van der Loo, Mark PJ and de Jonge, Edwin}, journal={Journal of
Statistical Software}, year={2021}, volume ={97}, issue = {10}, pages =
{1-33}, doi={10.18637/jss.v097.i10}, url =
{<https://www.jstatsoft.org/article/view/v097i10>} }
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: https://github.com/IBEEM-MSU/collaboratR
template:
bootstrap: 5
bootswatch: lumen
1 change: 1 addition & 0 deletions docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

81 changes: 81 additions & 0 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Content not found. Please use links in the navbar.

# Page not found (404)
Loading
Loading