|
|
|
|
|
|
|
|
rm(list = ls(all = TRUE)) |
|
|
|
|
|
|
|
|
setwd("~/Downloads/hbg_replication") |
|
|
|
|
|
|
|
|
|
|
|
if (!file.exists("output")) { |
|
|
dir.create("output") |
|
|
} |
|
|
|
|
|
|
|
|
hbg_log <- file("output/hbg_log.txt", open = "wt") |
|
|
|
|
|
|
|
|
sink(hbg_log, append = TRUE) |
|
|
sink(hbg_log, append = TRUE, type = "message") |
|
|
|
|
|
|
|
|
|
|
|
run_time <- system.time({source("scripts/hbg_cleaning.R", echo = TRUE, |
|
|
max.deparse.length = 10000) |
|
|
source("scripts/hbg_analysis.R", echo = TRUE, |
|
|
max.deparse.length = 10000)}) |
|
|
|
|
|
|
|
|
sink() |
|
|
sink(type = "message") |
|
|
|
|
|
|
|
|
run_time_file <- file("output/run_time", open = "wt") |
|
|
sink(run_time_file, append = TRUE) |
|
|
print(run_time) |
|
|
sink() |
|
|
|