SORTEE / peer-code-review

https://sortee.github.io/peer-code-review/
4 stars 4 forks source link

[CodeReviewRequest] #8

Open melina-leite opened 3 years ago

melina-leite commented 3 years ago

Author: Melina de Souza Leite

Repo: https://github.com/melina-leite/analysis_matrixBirds

Aim: The repository contains the data and code for the analysis of my PrePrint "Matrix quality determines the strength of habitat loss filtering on bird communities at the landscape scale". It basically documents all the steps I took for the analysis and results of the study, including data wrangling, descriptive statistics, modeling, and models' diagnostic. Nobody has reviewed (or even seen) this code, so I'm pretty sure there are many mistakes and ways to improve it in terms of readability and reproducibility, at least.

File Info: The .Rmd files in the main folder are numbered with the sequence of the data analysis (0 to 5), it should run without any problem. The reader/user could also follow all the analysis with the .pdf or *.htlm outputs of the Rmarkdown files.

melina-leite commented 2 years ago

Thanks, @DrMattG for the review!

The changes I've done in the repo since then:

Cleanup:

Then, I renamed some of the .Rmd files, because the file 1_APPENDIX_1.pdf is indeed from .docx file and not a .Rmd -> it contains the supplementary text for the study and I got just 1 figure and 2 tables from the 0_data_preparation.Rmd script.

I was in doubt about how to separate the files that I produced for the supplementary info, which are .pdf outputs from 3 of the .Rmd files (all chunks echo=F), from the .html outputs (all chunks echo=T), which I think may help the reader to follow the analysis or just figure out one or two steps or code of interest (e.g. models code). That's why I separated the appendix .pdf outputs from the htlm.

renv

This was totally new for me! Thanks for letting me know! I used the .Rproj options in Rstudio to set it. I think it works, but I still have to read and learn more about it!

Btw, do you guys think I should commit the .Rproj folder and files?

working directory (?!)

I found something weird and I want to share it with you. It's about setting a different working directory of the .Rmd file while rendering it and, at the same time, a different folder to save the output, considering that I was using the Rproj working directory in Rstudio. I can talk more about it in our meeting!

melina-leite commented 2 years ago

Points discussed and learned in our Zoom meeting today:

Confusing working directories:

knit: (function(inputFile, encoding) {
  rmarkdown::render(inputFile, encoding = encoding, output_dir = "../") })

CODE cleaning: