Introduction This website is the result of a project made during a teaching unit done by the FRB-CESAB in Montpellier (December 2021). All informations given in this website are based on the toolbox done for the teaching. This website is about coding in a reproducible workflow using R and is especially made for ecological studies but most concepts can be used for any study. What is Reproducible Research?
Let's create a research compendium
body {text-align: justify} Create a research compendium A research compendium is a folder providing data, code, and documentation, i.e. all you need to get a reproducing scientific workflow ! To create this amazing tool, open RStudio and create a new R-Project : File > New Project… Choose New Directory and then New Project. A new R-Project is created, it looks like this : Now the project is created, we are going to organize it as a compendium.
Use Git and Github
Why Git ? You now have a brand new research compendium built on your laptop. That’s great ! The next step is to track changes efficiently in the project . To do so we use git which is a control version application : instead of saving only the latest version, git allows us to take snapshots of the project regularly so that we save the full timeline. This is very interesting, especially to :
Create function and adapt structure
Introduction The basis of reproducibility is writing R functions instead of duplicating your code. Using functions helps you to have cleaner scripts and helps others to better understand your code: if you have weel-written functions with associated documentation, then others only have to read the documentation of your functions to understand your code. It’s way better than reading thousands of comments, right? No, let’s have a look at this wonderful and easy code technique that will revolutionize your code!
Create an automatised workflow: using make.R
Why using an automatised workflow? When you are coding, your life is a succession of: launching your code, waiting while it runs, discovering an issue and … restarting from scratch: Artwork from Pokemon USA So, to make your code life easier you can automatised your worklow so that re-running all your analysis only consist in running one file! Dependencies between the different steps of your analysis workflow have to be stated by using a make.
This is a website explaining how do a reproducible research in R. It is based on courses done by the FRB-CESAB and realized during a project by Erwan Harscouet, Lena Klay and Camille Magneville. The website has been made using the blogdown package. The theme used is the hugo-minos theme