Skip to content

Commit

Permalink
Merge pull request #761 from NREL/3.8.0-rc1
Browse files Browse the repository at this point in the history
Fix R package version error
  • Loading branch information
brianlball authored Apr 30, 2024
2 parents 7b0e2c0 + 684d93f commit cc94eaa
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions docker/R/install_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,35 @@
# https://raw.githubusercontent.com/NREL/docker-openstudio-r/master/base_packages.R

# Function for installing and verifying that the package was installed correctly (i.e. can be loaded)
install_and_verify = function(package_name, configure.args=c(), repos=c('http://cloud.r-project.org','http://cran.r-project.org')){
print(paste('Calling install for package ', package_name, sep=''))
install.packages(package_name, configure.args=configure.args, repos=repos)
install_and_verify = function(package_name, version=NULL, configure.args=c(), repos=c('http://cloud.r-project.org', 'http://cran.r-project.org')){
if (!is.null(version)) {
print(paste("Installing package", package_name, "version", version))
remotes::install_version(package_name, version=version, repos=repos)
} else {
print(paste('Calling install for package', package_name))
install.packages(package_name, configure.args=configure.args, repos=repos)
}

if (!require(package_name, character.only = TRUE)){
print('Error installing package, check log')
quit(status=1)
}
print(paste('Successfully installed and test loaded ', package_name, sep=''))
print(paste('Successfully installed and test loaded', package_name))
}

# Install Probability / Optimization / Analysis Packages
install_and_verify('lhs')
install_and_verify('e1071')
install_and_verify('triangle')
install_and_verify('NMOF')
install_and_verify('mco')
install_and_verify('rgenoud')
install_and_verify('conf.design')
install_and_verify('combinat')
install_and_verify('DoE.base')
install_and_verify('sensitivity')
install_and_verify('remotes')
install_and_verify('Matrix', version='1.6-5')
install_and_verify('lhs', version='1.1.6')
install_and_verify('e1071', version='1.7-14')
install_and_verify('triangle', version='1.0')
install_and_verify('NMOF', version='2.8-0')
install_and_verify('mco', version='1.16')
install_and_verify('rgenoud', version='5.9-0.10')
install_and_verify('conf.design', version='2.0.0')
install_and_verify('combinat', version='0.0-8')
install_and_verify('DoE.base', version='1.2-4')
install_and_verify('sensitivity', version='1.30.0')

# R Serve
install_and_verify('Rserve', configure.args=c('PKG_CPPFLAGS=-DNODAEMON'), repos=c('http://rforge.net'))

0 comments on commit cc94eaa

Please sign in to comment.