---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://catboost.ai/docs/en/installation/r-installation-github-installation.md
  - href: en/installation/r-installation-github-installation.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# Build R package from source directly from GitHub

{% note info %}

- <!-- source: en/_includes/work_src/reusage-installation/r__recommended-installation-method.md -->
  It is strongly recommended to [install the released version](https://catboost.ai/docs/en/installation/r-installation-binary-installation.md). Try it if other installation methods result in errors.
  <!-- endsource: en/_includes/work_src/reusage-installation/r__recommended-installation-method.md -->
  

- <!-- source: en/_includes/work_src/reusage-code-examples/nvidia-driver-reqs.md -->
  Training or inference on CUDA-enabled GPUs requires NVIDIA Driver of version 450.80.02 or higher.
  <!-- endsource: en/_includes/work_src/reusage-code-examples/nvidia-driver-reqs.md -->

{% endnote %}

To install the R package directly from the CatBoost repository:

1. Set up build environment

<!-- source: en/_includes/work_src/reusage-installation/setup-build-environment-alternatives.md -->
{% note warning %}

<!-- source: en/_includes/work_src/reusage-installation/ya-make-to-cmake-switch.md -->
CatBoost uses [CMake](https://cmake.org/)-based build process since [this commit](https://github.com/catboost/catboost/commit/c5c642ca0b8e093336d0229ac4b14c78db3915bb). Previously `Ya Make` (Yandex's build system) had been used.
<!-- endsource: en/_includes/work_src/reusage-installation/ya-make-to-cmake-switch.md -->

Select the appropriate build environment setup below accordingly.

{% endnote %}

  - [For CMake](https://catboost.ai/docs/en/installation/build-environment-setup-for-cmake.md)
  - [For Ya Make](https://catboost.ai/docs/en/installation/build-environment-setup-for-ya-make.md)
<!-- endsource: en/_includes/work_src/reusage-installation/setup-build-environment-alternatives.md -->

1. Run the following commands:

    ```
    install.packages('remotes')
    remotes::install_github('catboost/catboost', subdir = 'catboost/R-package')
    ```

<!-- source: en/_includes/work_src/reusage-installation/r__troubleshooting.md -->
#### Troubleshooting {#troubleshooting}

{% cut "Installation error" %}

If you use script for installation, try to add the `repos` parameter to the `install.packages('devtools')` command.
Select any repository from the [list](https://cran.r-project.org/mirrors.html).

Example: `install.packages("devtools", repos="http://cran.us.r-project.org")`.

{% endcut %}

{% cut "ERROR: some hard-coded temporary paths could not be fixed" %}

This can be mitigated by adding "--no-staged-install" option to `INSTALL_opts` parameter of `remotes::install_url` call

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-installation/r__troubleshooting.md -->
