https://github.com/pgcudahy/cookiecutter-r-analysis-template
Cookiecutter template for R data analysis with jupyter notebooks
https://github.com/pgcudahy/cookiecutter-r-analysis-template
cookiecutter-template jupyter r
Last synced: 4 months ago
JSON representation
Cookiecutter template for R data analysis with jupyter notebooks
- Host: GitHub
- URL: https://github.com/pgcudahy/cookiecutter-r-analysis-template
- Owner: pgcudahy
- License: mit
- Created: 2018-12-06T07:36:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-17T13:45:37.000Z (about 1 year ago)
- Last Synced: 2024-11-17T14:41:36.482Z (about 1 year ago)
- Topics: cookiecutter-template, jupyter, r
- Language: Shell
- Size: 38.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - pgcudahy/cookiecutter-r-analysis-template - Cookiecutter template for R data analysis with jupyter notebooks (Shell)
README
R data analysis template
========================
My template for automatically setting up a new data analysis project using [R](https://www.r-project.org/about.html).
This template uses [cookiecutter](https://github.com/audreyr/cookiecutter), a Python templating tool, to setup a directory structure,
set up an [renv](https://rstudio.github.io/renv/) reproducible environment, and initialize git.
Acknowledgements
----------------
Modified from [lazappi/cookiecutter-r-analysis](https://github.com/lazappi/cookiecutter-r-analysis),
[bdcalf/cookiecutter-r-data-analysis](https://github.com/bdcaf/cookiecutter-r-data-analysis),
and [khughitt/cookiecutter-rmd-data-science](https://github.com/khughitt/cookiecutter-rmd-data-science)
Requirements
------------
Install `cookiecutter` using `pip`:
```
pip install cookiecutter
```
**OR**
Install `cookiecutter` using `homebrew`:
```
brew install cookiecutter
```
Usage
-----
Generate a new project using:
```
cookiecutter gh:pgcudahy/cookiecutter-r-analysis-template
```
You will then be asked some questions to set up your project. Leaving answers
blank will select the default (shown in [brackets]).
Structure
---------
The resulting data analysis project will have the following structure:
```
project_title
├── README.md
├── artifacts - All results (eg figures, tables)
├── data - Intermediate data files (eg cleaned dataframes). These may be modified or deleted.
├── dataraw - All original input data. These may not be modified or deleted.
├── notebooks - Jupyter notebooks documenting all analysis.
└── r - Reusable R code (eg convenience functions).
```
Environment
-----------
After setting up the directory environment:
+ [renv](https://rstudio.github.io/renv/) is installed and used to manage a reproducible R environment
+ [Git](https://git-scm.com/) is initialized and an initial commit is made
Workflow
--------
+ Raw input data is put in the `dataraw` directory and should not be modified
+ Data is analyzed by Jupyter notebooks in the `notebooks` directory
+ Custom `R` source code used in the data analysis is put in the `r` folder
+ Transformed datasets are saved in the `data` directory. Must be able to be reproduced from the raw data and notebooks.
+ Output for publication or dissemination is put in the `artifacts` folder
License
-------
This project is licensed under the terms of the [MIT License](/LICENSE)