-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.qmd
96 lines (69 loc) · 2.39 KB
/
index.qmd
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
title: "Data pipelines for R/Pharma"
format:
html:
self-contained: true
---
# data-pipelines
## Structure
* Code: [rinpharma/data-pipelines](https://github.com/rinpharma/data-pipelines)
* Rendered run: [rinpharma.github.io/data-pipelines/](https://rinpharma.github.io/data-pipelines/)
* Output: Direct links below. Stored in gh-pages branch
## TO-DO
* [Put thought into columns](https://github.com/rinpharma/data-pipelines/issues/1)
## Rebuilding
This data (and this page) rebuild automatically based on the [CRON schedule specified in the github action](https://github.com/rinpharma/data-pipelines/blob/main/.github/workflows/pipeline.yml#L5).
Run the pipeline with `targets::tar_make()`
Check the pipeline with `targets::tar_manifest(fields = all_of("command"))`
Visualise the pipeline with `targets::tar_visnetwork()`
```{r, results = "asis", echo = FALSE, warnings = FALSE}
cat(c("```{mermaid}", targets::tar_mermaid(), "```"), sep = "\n")
```
## Output
The current files are available
* [processed_proceedings.parquet](output/processed_proceedings.parquet)
* [processed_team.parquet](output/processed_team.parquet)
* [processed_workshops.parquet](output/processed_workshops.parquet)
```{r}
arrow::read_parquet(
"https://rinpharma.github.io/data-pipelines/output/processed_proceedings.parquet"
) |>
dplyr::glimpse()
```
```{r}
arrow::read_parquet(
"https://rinpharma.github.io/data-pipelines/output/processed_team.parquet"
) |>
dplyr::glimpse()
```
```{r}
arrow::read_parquet(
"https://rinpharma.github.io/data-pipelines/output/processed_workshops.parquet"
) |>
dplyr::glimpse()
```
# Setup
Code to create gsheets token.
```{r, eval = FALSE}
# Generate credentials for gsheet access
pw_name <- gargle:::secret_pw_name("googlesheets4")
pw <- gargle:::secret_pw_gen()
added pwname_pw to usethis::edit_r_environ()
encrypt the service account token (I made via goodle dev console)
gargle:::secret_write(
package = "googlesheets4",
name = "rinpharma-4ac2ad6eba3b.json",
input = "~/Downloads/rinpharma-4ac2ad6eba3b.json"
)
encrypted file is now in /inst/
file_name <- "rinpharma-4ac2ad6eba3b.json"
secret_name <- "googlesheets4"
path <- paste0("inst/secret/", file_name)
raw <- readBin(path, "raw", file.size(path))
json <- sodium::data_decrypt(
bin = raw, key = gargle:::secret_pw_get(secret_name),
nonce = gargle:::secret_nonce()
)
pass <- rawToChar(json)
gs4_auth(path = pass)
```