mirror of
https://github.com/kidwellj/hacking_religion_textbook.git
synced 2024-11-01 09:22:21 +00:00
25 lines
823 B
Plaintext
25 lines
823 B
Plaintext
|
# Appendix A: how to set up a reproducible R script:
|
||
|
|
||
|
```
|
||
|
# R Setup -----------------------------------------------------------------
|
||
|
setwd("/Users/kidwellj/gits/hacking_religion_textbook/hacking_religion")
|
||
|
library(here) # much better way to manage working paths in R across multiple instances
|
||
|
here::i_am("chapter_1.qmd")
|
||
|
|
||
|
# Set up local workspace, as needed: --------------------------------------
|
||
|
|
||
|
# Set up paths in case they haven't already been created
|
||
|
|
||
|
if (dir.exists(here("data")) == FALSE) {
|
||
|
dir.create(here("data"))
|
||
|
}
|
||
|
|
||
|
# Note, these two paths are excluded from github as it is best practice in reproducible research for end-user to generate their own
|
||
|
|
||
|
if (dir.exists(here("figures")) == FALSE) {
|
||
|
dir.create(here("figures"))
|
||
|
}
|
||
|
|
||
|
if (dir.exists(here("derivedData")) == FALSE) {
|
||
|
dir.create(here("derivedData"))
|
||
|
}
|