diff --git a/R/R/prophet.R b/R/R/prophet.R index 0d14053..efde877 100644 --- a/R/R/prophet.R +++ b/R/R/prophet.R @@ -248,7 +248,11 @@ compile_stan_model <- function() { 'You should not see this message more than once after install.' ) - dest <- file.path(path.package("prophet"), 'libs') + if (.Platform$OS.type == "windows") { + dest <- file.path(path.package("prophet"), 'libs', .Platform$r_arch) + } else { + dest <- file.path(path.package("prophet"), 'libs') + } dir.create(dest, recursive = TRUE, showWarnings = FALSE) packageStartupMessage(paste('Writing model to:', dest)) diff --git a/R/R/zzz.R b/R/R/zzz.R index b8c32f5..f500968 100644 --- a/R/R/zzz.R +++ b/R/R/zzz.R @@ -7,8 +7,13 @@ # Create environment for storing stan model assign("prophet_model_env", new.env(), parent.env(environment())) tryCatch({ + if (.Platform$OS.type == "windows") { + dest <- file.path('libs', .Platform$r_arch) + } else { + dest <- 'libs' + } binary <- system.file( - 'libs', + dest, 'prophet_stan_model.RData', package = 'prophet', mustWork = TRUE