-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
49 lines (37 loc) · 1.26 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(magrittr)
library(stringr)
library(targets)
```
# Overview
A data science project built with [quarto](https://quarto.org/) and [targets](https://books.ropensci.org/targets/).
# Setup
- Create an R script called `_targets_config.R` in the project root directory with the following objects and populate:
```{r results='asis', eval=TRUE, echo=FALSE, warning=FALSE, message=FALSE}
result <- readLines(tar_read(TARGETS_CONFIG)) %>%
# subset for comments, object assignments and empty lines
subset(.,
str_detect(.,
"^#+ |<-|^$")) %>%
# remove assignments, leaving only object names
str_replace("<-.*$",
"<-") %>%
# print
paste(sep = "",
collapse = "\n")
cat(paste0("```",
"\n",
result,
"\n",
"```"))
```
- Install required R packages, ideally using [renv](https://rstudio.github.io/renv/) with `renv::init()`, or `renv::restore()` if a `renv.lock` file is already present.
- Run [targets pipeline](https://books.ropensci.org/targets/) with `tar_make()` in the R console.