From 703c0731f61044e065b4af1254352a8488312e9a Mon Sep 17 00:00:00 2001 From: "Sean J. Taylor" Date: Thu, 20 Dec 2018 17:04:03 -0800 Subject: [PATCH] Supress warning messages while building model --- R/src/install.libs.R | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/R/src/install.libs.R b/R/src/install.libs.R index 4c27ea1..84a0cd7 100644 --- a/R/src/install.libs.R +++ b/R/src/install.libs.R @@ -10,11 +10,17 @@ packageStartupMessage(paste('Compiling using binary:', R.home('bin'))) model.src <- file.path(R_PACKAGE_SOURCE, 'inst', 'stan', 'prophet.stan') model.binary <- file.path(dest, 'prophet_stan_model.RData') -model.stanc <- rstan::stanc(model.src) -model.stanm <- rstan::stan_model( - stanc_ret = model.stanc, - model_name = 'prophet_model' -) + +# See: https://github.com/r-lib/pkgbuild/issues/54#issuecomment-448702834 +# TODO: move stan compilation into Makevars +suppressMessages({ + model.stanc <- rstan::stanc(model.src) + model.stanm <- rstan::stan_model( + stanc_ret = model.stanc, + model_name = 'prophet_model' + ) +}) + save('model.stanm', file = model.binary) packageStartupMessage('------ Model successfully compiled!')