This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathappendix.Rmd
47 lines (36 loc) · 1.7 KB
/
appendix.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
# Appendix
```{r, echo = FALSE, message = FALSE, warning = FALSE}
quiet <- capture.output({
renv::activate(project = here::here())
#source(here::here("_common.R"))
})
library(here)
library(digest)
# hash algorithm picked based on https://csrc.nist.gov/projects/hash-functions
hash_algorithm <- "sha256"
#processed_file_digest is created in _common.R, but because the working directory issue, it is not created properly when _common.R is sourced here.
if (startsWith(tolower(study_name), "mock")) {
data_name_updated <- data_name
path_to_data = here::here("data_clean", data_name_updated)
} else {
data_name_updated <- data_cleaned
path_to_data = here::here("..", data_name_updated)
}
if (file.exists(path_to_data)) {
dat.mock <- read.csv(path_to_data)
print(paste0("reading data from ",data_name_updated))
# get hash of commit at HEAD
commit_hash <- system("git rev-parse HEAD", intern = TRUE)
# get hash of input processed data file based on chosen hashing algorithm
processed_file_digest <- digest(file = path_to_data, algo = hash_algorithm)
} else {
warning("dataset with risk score not available")
processed_file_digest = ""
}
```
* This report was built from the
[`CoVPN/correlates_reporting_usgcove_archive`](https://github.com/CoVPN/correlates_reporting_usgcove_archive)
repository with commit hash `r system("git rev-parse HEAD", intern = TRUE)`. A diff of the changes introduced
by that commit may be viewed at
https://github.com/CoVPN/correlates_reporting_usgcove_archive/commit/`r system("git rev-parse HEAD", intern = TRUE)`
* The `r hash_algorithm` hash sum of the processed file, `r paste0("\"",data_name_updated,"\"")`: `r processed_file_digest`