GithubHelp home page GithubHelp logo

jaeyk / makereproducible Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 69 KB

R package for making a project computationally reproducible before sharing it

Home Page: https://jaeyk.github.io/makereproducible/

License: MIT License

R 100.00%
here r reproducibility transparency

makereproducible's Introduction

makereproducible

An R Package for Making a Project Computationally Reproducible Before Sharing it

Author: Jae Yeon Kim

File an issue if you have problems, questions or suggestions.

Installation

## Install the current development version from GitHub

devtools::install_github("jaeyk/makereproducible",
        dependencies = TRUE)

library(makereproducible)

Usage

make_here

Creating self-contained projects is great to increase research reproducibility and make your life easier. To make a project self-contained, one of the things you need to do is STOP using setwd() and START using alternatives like here(). The problem is people, including, and especially me, are lazy. We know the best practice, but we don't follow it.

The make_here() function nudges you to make your project self-contained before sharing it with other people. It does this by saving typing time to turn the relative or absolute path in your R code into the arguments in the here() function.

To learn how to use it, see the examples below.

  1. Not self-contained because this absolute path only works in my laptop! (BAD)
read_csv("/home/jae/validating-two-linked-fates/raw_data/sub-data.txt")
  1. Voila! Now, the project is self-contained. (GOOD)
read_csv(make_here("/home/jae/validating-two-linked-fates/raw_data/sub-data.txt"))

Instructions

Only two conditions are needed to make the make_here() function work.

  • I assume that you created a main directory for your project (e.g., foo) and divided different types of files into different subdirectories (data, R, etc.).
  • I assume that you did one of the followings required by here package:
    • Had a checkout from a version control system like Git. (e.g., You have a subdirectory named .git.)
    • Made your project an RStudio project. (strongly recommended)
    • Put an empty file named .here in the main project directory (minimal effort).
  • here::dr_here() helps to check whether these two conditions were met. If setup correclty, you should be able to see something like the following: here() starts at [your main project directory], because it [satisfies one of the conditions listed above].

How to cite

If you would like to cite, please do something like the following:

Jae Yeon Kim. (2020). makereproducible. R package version 0.1.0. Retrieved from https://github.com/jaeyk/makereproducible

makereproducible's People

Contributors

jaeyk avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.