<commit_before>---
title: R Buildpack
owner: Buildpacks
---

<% if vars.product_name == "CF" %>

<div class="quick-links">
  <ul>
    <li><a href="#pushing_apps"> Push an App</a></li>
    <li><a href="#supported_versions">Supported Versions</a></li>
    <li><a href="#start_command">Start Command</a></li>
    <li><a href="#specifying_dependencies">Specifying App Dependencies</a></li>
    <li><a href="#vendoring">Vendoring App Dependencies</a></li>
    <li><a href="#proxy_support">Proxy Support</a></li>
    <li><a href="#bosh_trusted_cert">BOSH Configured Custom Trusted Certificate Support</a></li>
    <li><a href="#help_support">Help and Support</a></li>
 </ul>
</div>

<strong><%= modified_date %></strong>

## <a name='pushing_apps'></a> Push an App

Cloud Foundry automatically uses the R buildpack if it detects a
`r.yml` file in the root directory of your project.

If your Cloud Foundry deployment does not have the R buildpack installed, or the installed version is out of date, you can use the latest version by specifying it with the `-b` option when you push your app. For example:

<pre class="terminal">
$ cf push my_app -b https://github.com/cloudfoundry/r-buildpack.git
</pre>

## <a name='supported_versions'></a> Supported Versions

You can find the list of supported R versions in the 
[R buildpack release notes](https://github.com/cloudfoundry/r-buildpack/releases).


## <a name='start_command'></a>Start Command ###

The R buildpack does not generate a default start command for your applications. Instead, you must specify a start command for your app.

To stage an app with the R buildpack and start the app, do one of the following:

- **Option 1:**  Supply a Procfile. For more information about Procfiles, see  [Configuring a Production Server](../prod-server.html). The following example Procfile specifies `R -f` as the start command for a web app with the entrypoint `simple.r`:

    ```
    web: R -f simple.r
    ```

- **Option 2:** Specify a start command with `-c`:

    ```
    $ cf push r-app -c "R -f simple.r"
    ```

- **Option 3:** Specify a start command in the application manifest by setting the `command` attribute. For more information, see the [Deploying with Application Manifests](../../devguide/deploy-apps/manifest.html#start-commands) topic.

For more information about starting apps, 
see [Starting, Restarting, and Restaging Applications](../../devguide/deploy-apps/start-restart-restage.html).

## <a name='specifying_dependencies'></a> Specifying App Dependencies

As of v0.0.5, the following packages are provided by the buildpack:

- Rserve
- forecast
- shiny

To specify additional packages needed by your app, provide the CRAN mirror and names of the packages inside your `r.yml` file. For example:

```
---
packages:
  - cran_mirror: https://cran.r-project.org
    packages:
      - name: stringr
      - name: jsonlite
```

## <a name='vendoring'></a> Vendoring App Dependencies

If you are deploying in an environment that is disconnected from the Internet, you must _vendor_ your app's dependencies, which means you must make these packages available for offline use. You can vendor dependencies by using a package manager. 

To set up your own custom, local CRAN-like repository to vendor your packages, create the `src/contrib` directories and populate them with your package source tarballs. For more information, see [How to Set Up a Custom CRAN-like Repository](https://rstudio.github.io/packrat/custom-repos.html) published on the _Packrat Documentation_ site.

Add the `src/contrib` directories containing your package tarballs to a `vendor_r` directory at the root of your app. This directory is named `vendor_r` so as not to conflict with vendor directories of other languages, such as python.

Then, inside your `r.yml`, provide the names of your vendored packages in the `packages` list:

<pre class="terminal">
---
packages:
  - packages:
      - name: stringr
      - name: jsonlite
</pre>

`cf push` uploads your vendored dependencies. The buildpack installs them directly from the `vendor_r/` directory.

Example app directory tree:

```
├── r.yml
├── simple-app.r
└── vendor_r
    └── src
        └── contrib
            ├── PACKAGES
            ├── PACKAGES.gz
            ├── jsonlite_1.5.tar.gz
            └── stringr_1.3.1.tar.gz
```

For more information about using buildpacks in disconnected environments, see [Disconnected environments](https://github.com/cf-buildpacks/buildpack-packager/blob/master/doc/disconnected_environments.md).

## <a name='proxy_support'></a> Proxy Support

If you need to use a proxy to download dependencies during staging, you can set
the `http_proxy` and `https_proxy` environment variables. For more information, see the [Proxy Usage Documentation](../proxy-usage.html).


## <a name='bosh_trusted_cert'></a> BOSH Configured Custom Trusted Certificate Support

R uses certificates stored in `/etc/ssl/certs`. Your platform operator can configure the platform to add the custom certificates into the application container. For more information, see [Configuring Trusted Sytsem Certificates for Applications](../../running/trusted-system-certificates.html).


## <a name='help_support'></a> Help and Support

Join the **#buildpacks** channel in our [Slack community](http://slack.cloudfoundry.org/) if you need any further assistance.

For more information about using and extending the R buildpack in Cloud Foundry, see the [R-buildpack GitHub repository](https://github.com/cloudfoundry/r-buildpack).

You can also find current information about this buildpack on the [R buildpack
release page](https://github.com/cloudfoundry/r-buildpack/releases) in GitHub.

<% else %>

<%= vars.support_note %>
<commit_msg>[#160865442] oops, forgot "end"<commit_after>---
title: R Buildpack
owner: Buildpacks
---

<% if vars.product_name == "CF" %>

<div class="quick-links">
  <ul>
    <li><a href="#pushing_apps"> Push an App</a></li>
    <li><a href="#supported_versions">Supported Versions</a></li>
    <li><a href="#start_command">Start Command</a></li>
    <li><a href="#specifying_dependencies">Specifying App Dependencies</a></li>
    <li><a href="#vendoring">Vendoring App Dependencies</a></li>
    <li><a href="#proxy_support">Proxy Support</a></li>
    <li><a href="#bosh_trusted_cert">BOSH Configured Custom Trusted Certificate Support</a></li>
    <li><a href="#help_support">Help and Support</a></li>
 </ul>
</div>

<strong><%= modified_date %></strong>

## <a name='pushing_apps'></a> Push an App

Cloud Foundry automatically uses the R buildpack if it detects a
`r.yml` file in the root directory of your project.

If your Cloud Foundry deployment does not have the R buildpack installed, or the installed version is out of date, you can use the latest version by specifying it with the `-b` option when you push your app. For example:

<pre class="terminal">
$ cf push my_app -b https://github.com/cloudfoundry/r-buildpack.git
</pre>

## <a name='supported_versions'></a> Supported Versions

You can find the list of supported R versions in the 
[R buildpack release notes](https://github.com/cloudfoundry/r-buildpack/releases).


## <a name='start_command'></a>Start Command ###

The R buildpack does not generate a default start command for your applications. Instead, you must specify a start command for your app.

To stage an app with the R buildpack and start the app, do one of the following:

- **Option 1:**  Supply a Procfile. For more information about Procfiles, see  [Configuring a Production Server](../prod-server.html). The following example Procfile specifies `R -f` as the start command for a web app with the entrypoint `simple.r`:

    ```
    web: R -f simple.r
    ```

- **Option 2:** Specify a start command with `-c`:

    ```
    $ cf push r-app -c "R -f simple.r"
    ```

- **Option 3:** Specify a start command in the application manifest by setting the `command` attribute. For more information, see the [Deploying with Application Manifests](../../devguide/deploy-apps/manifest.html#start-commands) topic.

For more information about starting apps, 
see [Starting, Restarting, and Restaging Applications](../../devguide/deploy-apps/start-restart-restage.html).

## <a name='specifying_dependencies'></a> Specifying App Dependencies

As of v0.0.5, the following packages are provided by the buildpack:

- Rserve
- forecast
- shiny

To specify additional packages needed by your app, provide the CRAN mirror and names of the packages inside your `r.yml` file. For example:

```
---
packages:
  - cran_mirror: https://cran.r-project.org
    packages:
      - name: stringr
      - name: jsonlite
```

## <a name='vendoring'></a> Vendoring App Dependencies

If you are deploying in an environment that is disconnected from the Internet, you must _vendor_ your app's dependencies, which means you must make these packages available for offline use. You can vendor dependencies by using a package manager. 

To set up your own custom, local CRAN-like repository to vendor your packages, create the `src/contrib` directories and populate them with your package source tarballs. For more information, see [How to Set Up a Custom CRAN-like Repository](https://rstudio.github.io/packrat/custom-repos.html) published on the _Packrat Documentation_ site.

Add the `src/contrib` directories containing your package tarballs to a `vendor_r` directory at the root of your app. This directory is named `vendor_r` so as not to conflict with vendor directories of other languages, such as python.

Then, inside your `r.yml`, provide the names of your vendored packages in the `packages` list:

<pre class="terminal">
---
packages:
  - packages:
      - name: stringr
      - name: jsonlite
</pre>

`cf push` uploads your vendored dependencies. The buildpack installs them directly from the `vendor_r/` directory.

Example app directory tree:

```
├── r.yml
├── simple-app.r
└── vendor_r
    └── src
        └── contrib
            ├── PACKAGES
            ├── PACKAGES.gz
            ├── jsonlite_1.5.tar.gz
            └── stringr_1.3.1.tar.gz
```

For more information about using buildpacks in disconnected environments, see [Disconnected environments](https://github.com/cf-buildpacks/buildpack-packager/blob/master/doc/disconnected_environments.md).

## <a name='proxy_support'></a> Proxy Support

If you need to use a proxy to download dependencies during staging, you can set
the `http_proxy` and `https_proxy` environment variables. For more information, see the [Proxy Usage Documentation](../proxy-usage.html).


## <a name='bosh_trusted_cert'></a> BOSH Configured Custom Trusted Certificate Support

R uses certificates stored in `/etc/ssl/certs`. Your platform operator can configure the platform to add the custom certificates into the application container. For more information, see [Configuring Trusted Sytsem Certificates for Applications](../../running/trusted-system-certificates.html).


## <a name='help_support'></a> Help and Support

Join the **#buildpacks** channel in our [Slack community](http://slack.cloudfoundry.org/) if you need any further assistance.

For more information about using and extending the R buildpack in Cloud Foundry, see the [R-buildpack GitHub repository](https://github.com/cloudfoundry/r-buildpack).

You can also find current information about this buildpack on the [R buildpack
release page](https://github.com/cloudfoundry/r-buildpack/releases) in GitHub.

<% else %>

<%= vars.support_note %>

<% end %>

{'fraction_non_alphanumeric': 0.11457880552899244, 'fraction_numerical': 0.002694949143701643, 'mean_word_length': 4.1449016100178895, 'pattern_counts': {'":': 0, '<': 128, '<?xml version=': 0, '>': 128, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2182146', 'n_tokens_mistral': 3430, 'n_tokens_neox': 3281, 'n_words': 1306}