Giter VIP home page Giter VIP logo

heroku-buildpack-r's Introduction

Heroku buildpack: R

This is a Heroku buildpack for applications which use R for statistical computing and CRAN for R packages.

R is ‘GNU S’, a freely available language and environment for statistical computing and graphics which provides a wide variety of statistical and graphical techniques: linear and nonlinear modelling, statistical tests, time series analysis, classification, clustering, etc. Please consult the R project homepage for further information.

CRAN is a network of ftp and web servers around the world that store identical, up-to-date, versions of code and documentation for R.

Usage

Example usage:

$ ls
init.r prog1.r prog2.r ...

$ heroku create --stack cedar --buildpack http://github.com/virtualstaticvoid/heroku-buildpack-r.git

$ git push heroku master
...
-----> Heroku receiving push
-----> Fetching custom buildpack
-----> R app detected
-----> Vendoring R x.xx.x
       Executing init.r script
...
-----> R successfully installed

The buildpack will detect your app makes use of R if it has the init.r file in the root. The R runtime is vendored into your slug, and includes the gcc compiler for fortran support.

To reference a specific version of the build pack, add the Git branch or tag name to the end of the build pack URL.

$ heroku create --stack cedar --buildpack http://github.com/virtualstaticvoid/heroku-buildpack-r.git#master

Installing R packages

During the slug compilation process, the init.r R file is executed. Put code in this file to install any packages you may require. See the Installing-packages for details. The list of available packages can be found at http://cran.r-project.org.

# Example `init.r` file

install.packages("nlme", dependencies = TRUE)

R packages can also be included in your project source and installed when the init.r file is executed.

install.packages("optional-path-to-packages/local-r-package-file.tar.gz", repos=NULL, type="source")

R Console

You can also run the R console application as follows:

$ heroku run R

Type q() to exit the console when you are finished.

Note that the Heroku slug is read-only, so any changes you make during the session will be discarded.

Using in your applications

This buildpack can be used in conjunction with other supported language stacks on Heroku by using the heroku-buildpack-multi buildpack.

See the example test applications which show how to use R from the console and a simple Ruby application.

R Binaries

The binaries used by the buildpack are for R 2.15.1, and are hosted on s3://heroku-buildpack-r/R-2.15.1-binaries.tar.gz

See the guide for building the R binaries yourself.

Caveats

Due to the size of the R runtime, the slug size on Heroku, without any additional packages or program code, is approximately 98Mb. If additional R packages are installed by the init.r script then the slug size will increase.

githalytics.com alpha

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.