This repository is intended to use as a demo about how I organize my research projects: from data to manuscript.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Data/Raw_data set up project Feb 8, 2015
Doc add responses to reviwers template Nov 16, 2017
Figs relocate template files Apr 26, 2017
R update with bookdown package Feb 28, 2017
template Update respond_to_reviewer.tex May 8, 2018
.gitignore ignore Mac files Feb 28, 2017
LICENSE Initial commit Feb 7, 2015
Makefile change makefile. Apr 26, 2017
README.md change makefile. Apr 26, 2017
demo.Rproj add a rstudio project file Feb 28, 2017

README.md

workflow_demo

This repository is intended to use as a demo about how I organize my research projects: from data to manuscript. The idea is to make things automated and organized as much as possible and, of course, use version control across the workflow.

This repository has the following file folders:

  • Data: this folder is used to hold raw data and output data.
  • R: this folder holds all R codes.
  • Figs holds figures generated from R codes.
  • Doc: this folder holds manuscripts.

Some prerequires:

  • GNU Make: to document file dependencies and automate workflow. In terminal, you can just type make to render the rmarkdown file to pdf and html.
  • R: for data clean and analyses.
  • LaTeX: for fine control of typesetting and pdf generation.
  • Pandoc: for file types converting, e.g. convert markdown file to pdf or docx files or html files.
    • if you have Rstudio installed, you can also use pandoc shipped with Rstudio:

        sudo ln -s /usr/lib/rstudio/bin/pandoc/pandoc /usr/local/bin   
        sudo ln -s /usr/lib/rstudio/bin/pandoc/pandoc-citeproc /usr/local/bin
      

Contributing

Contributions to this demo are more than welcome. Just fork and make changes, then file a pull request. Thanks!

# https://gist.github.com/stevenworthington/3178163
# ipak function: install and load multiple R packages.
# check to see if packages are installed. Install them if they are not, then load them into the R session.

ipak <- function(pkg){
  new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
  if (length(new.pkg)) 
    install.packages(new.pkg, dependencies = TRUE)
  sapply(pkg, require, character.only = TRUE)
}

pkgs = c("rmarkdown", "bookdown", "tidyverse", "xtable", "tufte")
ipak(pkgs)