<- read.csv("my_data_file.csv")
data # excluded as participant entered an invalid CPR number
<- data %>% filter(id != "2321369-1212") data
…workflow
2023-01-01
The entire process from raw data to output should be:
- scripted
- reproducible
- reversible
The entire process from raw data to output should be:
E.g.
..but why not just delete that observation in raw data..?
http://www.sthda.com/english/wiki/best-practices-in-preparing-data-files-for-importing-into-r
For now don’t change anything and don’t get bogged down in all the details of the code in each file … just get an overview, see if you can understand the code and how it ties together.
This exercise is best done in pairs.
Let’s try to:
The manuscript you are submitting to, has some specific requirements:
How would you change the code?
A simple human readable text file format for references
An open source, free reference manager – well integrated with firefox.
Allows for shared libraries.
Plugin BetterBibTex for … well, better bibTeX.
Alternatives: Mendeley (Elsevier), EndNote, RefManager, etc
Loads of styles … 10.000+ … from APA to Ugeskrift for Læger
…and you can write your own if need be.
https://www.zotero.org/styles
(without Zotero)
Three scenarios :
Benefits
Drawbacks
There are also several online version .. e.g. https://editor.mergely.com/
…you probably should not upload sensitive information though.
Benefits
Drawback
…enter GIT and renv
Not very difficult at all.
- Maintains a library of R packages along with r code
- Updates to R and packages does not break your project
- Permits you to come back in 5 years and re-execute your code
https://rstudio.github.io/renv/articles/renv.html
It is a bit difficult.
- Instead of storing multiple versions of the same file …
- ..it stores just the one file, and a (hidden) version-history
- Changes are handled by Diff’ing versions
- All changes (process) are documented
- All changes (process) are reversible
- Projects are forkable and mergable
- indispensable for LARGE projects
- GIT is a separate program, supported by RStudio.