Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kauedesousa authored Jan 22, 2024
0 parents commit 8896992
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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".

8 changes: 8 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -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

8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -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

7 changes: 7 additions & 0 deletions output/README.md
Original file line number Diff line number Diff line change
@@ -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"


4 changes: 4 additions & 0 deletions processing/README.md
Original file line number Diff line number Diff line change
@@ -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.

13 changes: 13 additions & 0 deletions script/README.md
Original file line number Diff line number Diff line change
@@ -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



13 changes: 13 additions & 0 deletions template-repo-data-analysis.Rproj
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8896992

Please sign in to comment.