Skip to content

Commit e718d3b

Browse files
committed
adding support for ProjectTemplate and default output directory for exported results
1 parent ea9ac6c commit e718d3b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/globals.R

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ add.config(
88
apply.override = TRUE
99
)
1010

11+
loc.output <- here::here("output")
12+
loc.logs <- here::here("logs")
13+
1114
# Configure logger
12-
logger.file <- file.path(here::here("logs"), strftime(Sys.time(), "app_%Y-%m-%d.log"))
15+
logger.file <- file.path(loc.logs, strftime(Sys.time(), "app_%Y-%m-%d.log"))
1316
logger <-
1417
logger("DEBUG", appenders = list(
1518
console_appender(),
1619
file_appender(file = logger.file, append = T)
17-
))
20+
))

src/Summary Plots Hospital Bed Capacity Model.R

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ if(require("ProjectTemplate")) install.packages("ProjectTemplate")
2323
library(ProjectTemplate)
2424
load.project()
2525

26-
loc.output <- here::here("output")
27-
#Set working directory to current file location
28-
2926
#Load CSVs
3027
withr::with_dir(loc.output, {
3128
ASSUMPTIONS <- read.csv(paste("SS_R_TRIAL_ASSUMPTIONS_TRACKER_",INPUTSET,".csv",sep=""))
@@ -35,7 +32,7 @@ withr::with_dir(loc.output, {
3532
ICU_QTIME <- read.csv(paste("SS_R_INPT_Q_TIME_ICU_ELIGIBLE_BY_DAY_",INPUTSET,".csv",sep=""))
3633
TURNEDAWAY <- read.csv(paste("SS_R_TURNED_AWAY_COMPLETED_BY_DAY_",INPUTSET,".csv",sep=""))
3734
Q_CONTENTS <- read.csv(paste("SS_R_INPT_Q_CONTENTS_END_OF_DAY_",INPUTSET,".csv",sep=""))
38-
}}
35+
})
3936

4037
#This is used to name results file PDFs.
4138
SETLABEL <- INPUTSET

0 commit comments

Comments
 (0)