Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
Last active October 23, 2018 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtualstaticvoid/663869936eb0f2f7d34472b6287c6382 to your computer and use it in GitHub Desktop.
Save virtualstaticvoid/663869936eb0f2f7d34472b6287c6382 to your computer and use it in GitHub Desktop.
heroku-buildpack-r/issues/113

See virtualstaticvoid/heroku-buildpack-r#113

heroku create --stack heroku-16

heroku buildpacks:add https://github.com/heroku/heroku-buildpack-python.git
heroku buildpacks:add https://github.com/virtualstaticvoid/heroku-buildpack-r.git#heroku-16

git push heroku master

heroku run R --no-save -f /app/test.R
heroku run python /app/test.py
#
# Example R code to install packages
# See http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages for details
#
###########################################################
# Update this line with the R packages to install:
my_packages = c()
###########################################################
install_if_missing = function(p) {
if (p %in% rownames(installed.packages()) == FALSE) {
install.packages(p)
}
else {
cat(paste("Skipping already installed package:", p, "\n"))
}
}
invisible(sapply(my_packages, install_if_missing))
# python packages
#
# Example Python program
#
print("Hello World from Python!")
#
# Example R program
#
print("Hello World from R!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment