install.libs.R 754 B

12345678910111213141516171819202122
  1. packageStartupMessage('Compiling model (this will take a minute...)')
  2. dest <- file.path(R_PACKAGE_DIR, paste0('libs', R_ARCH))
  3. dir.create(dest, recursive = TRUE, showWarnings = FALSE)
  4. packageStartupMessage(paste('Writing model to:', dest))
  5. packageStartupMessage(paste('Compiling using binary:', R.home('bin')))
  6. model.src <- file.path(R_PACKAGE_SOURCE, 'inst', 'stan', 'prophet.stan')
  7. model.binary <- file.path(dest, 'prophet_stan_model.RData')
  8. model.stanc <- rstan::stanc(model.src)
  9. model.stanm <- rstan::stan_model(
  10. stanc_ret = model.stanc,
  11. model_name = 'prophet_model'
  12. )
  13. save('model.stanm', file = model.binary)
  14. packageStartupMessage('------ Model successfully compiled!')
  15. packageStartupMessage('You can ignore any compiler warnings above.')