Skip to content

Commit 5b5846e

Browse files
committed
add a helper to source all data-generating files
1 parent 736eb64 commit 5b5846e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

data-raw/_run_all.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
library(here)
2+
3+
internal_data_path <- here("data-raw")
4+
files <- list.files(
5+
internal_data_path, pattern = ".*[.]R",
6+
full.names = FALSE
7+
)
8+
for (file in files) {
9+
if (startsWith(file, "_")) {
10+
# File is a helper script and does not generate data.
11+
next
12+
}
13+
path <- here(file)
14+
message("running ", path, " ...")
15+
source(path)
16+
}

0 commit comments

Comments
 (0)