Giter Site home page Giter Site logo

sketchy's Introduction

sketchy: create custom research compendiums

lifecycle Dependencies Project Status: Active The project has reached a stable, usable state and is being actively developed. Licence minimal R version CRAN_Status_Badge Total Downloads

sketchy sticker

The package is intended to facilitate the use of research compendiums for data analysis in the R environment. Standard research compendiums provide a easily recognizable means for organizing digital materials, allowing other researchers to inspect, reproduce, and build upon that research.

Unlike other R packages for creating research compendiums (e.g. vertical, rrtools), sketchy isn’t wedded to a particular folder structure. Currently the package provides 14 alternative structures (see object compendiums) and allows users to modify or input their own structures.

To install the latest developmental version from github you will need the R package remotes:

# From github
remotes::install_github("maRce10/sketchy")

# load package
library(sketchy)

Default compendium skeletons

Compendiums can be set up with the function make_compendium(). The function creates the folder/subfolder structure and prints a diagram of the skeleton in the console:

Basic compendium

path = tempdir()

# load data
data(compendiums)

make_compendium(name = "proyect_x", path = path, format = "basic")
## Creating directories ...
## proyect_x
## │   
## ├── data/  
## │   ├── processed/  # modified/rearranged data
## │   └── raw/  # original data
## ├── manuscript/  # manuscript/poster figures
## ├── output/  # all non-data products of data analysis
## └── scripts/  # code
## Done.

 

(in these examples the compendiums are created in a temporary directory, change ‘path’ to create it in a different directory)

Alternative structures

We can use folder structures from other sources. For instance, in this example we use the structured suggested by Wilson et al. (2017):

make_compendium(name = "proyect_z", path = path, format = "large_compendium")
## Creating directories ...
## proyect_z
## │   
## ├── analysis/  # Data, scripts, RMarkdown reports and Makefile
## │   ├── data/  # Raw data in open formats, not changed once created
## │   └── scripts/  # R code used to analyse and visualise data
## ├── man/  # Auto-generated documentation for the custom R functions
## ├── R/  # Custom R functions used repeatedly throughout the project
## └── tests/  # Unit tests of R functions to ensure they perform as expected
## Done.

 

When creating a compendium that includes a “manuscript” folder the package adds a “manuscript_template.Rmd” file for facilitating paper writing within the compendium itself.

We can check all compendium structure available as follows:

for (i in 1:length(compendiums)) {
    print("---------------", quote = FALSE)
    print(names(compendiums)[i], quote = FALSE)
    print_skeleton(folders = compendiums[[i]]$skeleton)
}
## [1] ---------------
## [1] basic
## .
## │   
## ├── data/  
## │   ├── processed/  
## │   └── raw/  
## ├── manuscript/  
## ├── output/  
## └── scripts/  
## [1] ---------------
## [1] figures
## .
## │   
## ├── data/  
## │   ├── processed/  
## │   └── raw/  
## ├── manuscript/  
## ├── output/  
## │   └── figures/  
## │       ├── exploratory/  
## │       └── final/  
## └── scripts/  
## [1] ---------------
## [1] project_template
## .
## │   
## ├── cache/  
## ├── config/  
## ├── data/  
## ├── diagnostics/  
## ├── docs/  
## ├── graphs/  
## ├── lib/  
## ├── logs/  
## ├── munge/  
## ├── profiling/  
## ├── reports/  
## ├── src/  
## └── tests/  
## [1] ---------------
## [1] pakillo
## .
## │   
## ├── analyses/  
## ├── data/  
## ├── data-raw/  
## ├── docs/  
## ├── inst/  
## ├── man/  
## ├── manuscript/  
## ├── R/  
## └── tests/  
## [1] ---------------
## [1] boettiger
## .
## │   
## ├── man/  
## ├── R/  
## ├── tests/  
## └── vignettes/  
## [1] ---------------
## [1] wilson
## .
## │   
## ├── data/  
## ├── doc/  
## ├── requirements/  
## ├── results/  
## └── src/  
## [1] ---------------
## [1] small_compendium
## .
## │   
## ├── analysis/  
## └── data/  
## [1] ---------------
## [1] medium_compendium
## .
## │   
## ├── analysis/  
## ├── data/  
## ├── man/  
## └── R/  
## [1] ---------------
## [1] large_compendium
## .
## │   
## ├── analysis/  
## │   ├── data/  
## │   └── scripts/  
## ├── man/  
## ├── R/  
## └── tests/  
## [1] ---------------
## [1] vertical
## .
## │   
## ├── data/  
## ├── data-raw/  
## ├── docs/  
## ├── experiments/  
## ├── man/  
## ├── manuscripts/  
## ├── model/  
## ├── posters/  
## ├── R/  
## ├── slides/  
## └── vignettes/  
## [1] ---------------
## [1] rrtools
## .
## │   
## ├── analysis/  
## ├── data/  
## ├── figures/  
## ├── paper/  
## └── templates/  
## [1] ---------------
## [1] rdir
## .
## │   
## ├── code/  
## │   ├── processed/  
## │   └── raw/  
## ├── data/  
## │   ├── clean/  
## │   └── raw/  
## ├── figures/  
## │   ├── exploratory/  
## │   └── final/  
## └── text/  
##     ├── final/  
##     └── notes/  
## [1] ---------------
## [1] workflowr
## .
## │   
## ├── analysis/  
## ├── code/  
## ├── data/  
## ├── docs/  
## └── output/  
## [1] ---------------
## [1] sketchy
## .
## │   
## ├── data/  
## │   ├── processed/  
## │   └── raw/  
## ├── manuscript/  
## ├── output/  
## └── scripts/

Please cite sketchy as follows:

Araya-Salas, M., Willink, B., Arriaga, A. (2020), sketchy: research compendiums for data analysis in R. R package version 1.0.0.

References

  1. Alston, J., & Rick, J. (2020). A Beginner’s Guide to Conducting Reproducible Research.

  2. Marwick, B., Boettiger, C., & Mullen, L. (2018). Packaging Data Analytical Work Reproducibly Using R (and Friends). American Statistician, 72(1), 80–88.

  3. Wilson G, Bryan J, Cranston K, Kitzes J, Nederbragt L. & Teal, T. K.. 2017. Good enough practices in scientific computing. PLOS Computational Biology 13(6): e1005510.

sketchy's People

Contributors

marce10 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sketchy's Issues

Any way to specify a README.md instead of .Rmd?

Hello! I'm using your package to generate a compendium and hoping to use holepunch to prepare it for binderizing. Otherwise, do you have any recommendations on how to best automate rendering a .md file for GH from the .Rmd? Thanks!

function to check file size

  • can be part of the continuous integration overall function
  • allow users to add big files to .gitignore and upload them to research data repositories (zenodo or figshare)

Error when using rdir as format when creating a compendium

In console the code is

sketchy::make_compendium(path = ruta, name = "rdir", format = "rdir")
Creating directories ...
Error: cannot create directory '/home/andrea/Downloads/borrar/rdir/data/raw'
In addition: Warning message:
In dir.create(path) :
cannot create dir '/home/andrea/Downloads/borrar/rdir/data/raw', reason 'No such file or directory'

The structure of the file created is:

rdir

└── code/
├── processed/
└── raw/

"Error in tolower" when creatin compendiums. Error Prevents Printing Skeletons

All the types of compendiums are having errors, but it is still creating the folders.

Code:

make_compendium(name = "project_workflowr_skeleton", path = path, format = "workflowr") # Da error pero si crea la carpeta

Creating directories ...
Error in tolower(xfun::file_ext(input)) :
lazy-load database '/home/andrea/R/x86_64-pc-linux-gnu-library/4.3/xfun/R/xfun.rdb' is corrupt
In addition: Warning messages:
1: In tolower(xfun::file_ext(input)) :
restarting interrupted promise evaluation
2: In tolower(xfun::file_ext(input)) : internal error -3 in R_decompress1

print_skeleton(path = paste0(path, "project_workflowr_skeleton")) # Da error

Error in lapply(list(...), as.character) :
lazy-load database '/home/andrea/R/x86_64-pc-linux-gnu-library/4.3/stringi/R/stringi.rdb' is corrupt
In addition: Warning messages:
1: In lapply(list(...), as.character) :
restarting interrupted promise evaluation
2: In lapply(list(...), as.character) : internal error -3 in R_decompress1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.