diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d02e519 --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +# History files +.Rhistory +.Rapp.history + +# Session Data files +.RData +.DS_Store + +# User-specific files +.Ruserdata + +# Example code in package build process +*-Ex.R + +# RStudio files +.Rproj.user/ + + +# Temporary files created by R markdown +*.utf8.md +*.knit.md + +# R Environment Variables +.Renviron + +# ClimMob API key +token/api-key.txt +*.png diff --git a/README.md b/README.md new file mode 100644 index 0000000..98998b7 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Template analysis workflow + +This is a template for R projects for data analysis. For repositories with other goals please look at other templates (if any). Create your new repository using this template, then clone the repo and change the name of the existing R-project file .Rproj or create a new R-project (https://bookdown.org/daniel_dauber_io/r4np_book/starting-your-r-projects.html) + +Suggestions/comments on this template or for new templates are welcome! + +## Project-oriented workflow + +Why we use project-oriented workflow? Here is the answer (https://www.tidyverse.org/blog/2017/12/workflow-vs-script/). From these recommendations the only thing that I think we can skip is using the package "here". + diff --git a/data/README.md b/data/README.md new file mode 100644 index 0000000..563121e --- /dev/null +++ b/data/README.md @@ -0,0 +1,8 @@ +# data + +All data used for the analysis must be here. Try your best to keep all the files that you need for the analysis in this folder. If you have big files, please document and provide a persistent link to access the data. + +Hint 1. Avoid names with backspace and use "-" or "_" to separate names. eg. this "bean-data-arusha.csv" instead of this "Bean data Arusha.csv" + +Hint 2. Create a sub-folder "data/raw" do add data in the raw format and that need to be heavily cleaned or organized before the analysis + diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..dc038ba --- /dev/null +++ b/docs/README.md @@ -0,0 +1,8 @@ +# docs + +This is an optional folder. If you plan to write R notebooks, a report, a scientific paper or any document that will summarize/describe the work done in this workflow, use this folder. + +Hint 1. In a .rmd doc, files in the folder output can be called using "../output/filename.extension" + +Hint 2. Use the R package `rticles` to get templates for scientific papers + diff --git a/output/README.md b/output/README.md new file mode 100644 index 0000000..58e29bf --- /dev/null +++ b/output/README.md @@ -0,0 +1,7 @@ +# outputs + +All the outputs must be written here. + +Hint 1. Avoid names with backspace and use "-" or "_" to separate names. eg. this "plot-bean-yield.png" instead of this "Plot Bean Yield.csv" + + diff --git a/processing/README.md b/processing/README.md new file mode 100644 index 0000000..b597e0e --- /dev/null +++ b/processing/README.md @@ -0,0 +1,4 @@ +# processing + +This is an optional folder. Files that are too heavy or big to be processed during analysis can rest here. + diff --git a/script/README.md b/script/README.md new file mode 100644 index 0000000..b7914f9 --- /dev/null +++ b/script/README.md @@ -0,0 +1,13 @@ +# scripts + +All scripts used in the analysis must be here. + +Hint 1. Put your scripts in numeric order, then everybody knows where to start. e.g. + +- 00-functions.R +- 01-data-cleaning-bean-yield.R +- 02-analysis-yield-estimation.R +- 03-produce-maps.R + + + diff --git a/template-repo-data-analysis.Rproj b/template-repo-data-analysis.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/template-repo-data-analysis.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX