Skip to content

Commit

Permalink
modified dir_path to use local_dir in ensemble.R and addedlibrary(jso…
Browse files Browse the repository at this point in the history
…nlite)
  • Loading branch information
kjsato committed Mar 25, 2024
1 parent 5c7839b commit 3f73988
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/ensemble.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ library(hubData)
library(hubEnsembles)
library(dplyr)
library(purrr)
library(jsonlite)

## ----setup_specifics, include=FALSE---------------------------------------------------

dates_archive <- unlist(jsonlite::read_json(file.path(dir_path, "hub-config/tasks.json"))$rounds[[1]]$model_tasks[[1]]$task_ids$origin_date$optional)
dates_archive <- unlist(jsonlite::read_json(file.path(local_path, "hub-config/tasks.json"))$rounds[[1]]$model_tasks[[1]]$task_ids$origin_date$optional)
dates_archive <- dates_archive[as.Date(dates_archive) <= Sys.Date()]

curr_origin_date <- as.Date(max(dates_archive, na.rm = TRUE))

## ----prep_ens, include=FALSE--------------------------------------------------
hub_path <- file.path(dir_path, "hub-config")
hub_path <- file.path(local_path, "hub-config")
hub_con <- connect_hub(hub_path)

## ----load_data, include=FALSE--------------------------------------------------
Expand Down

0 comments on commit 3f73988

Please sign in to comment.