# How to install a R package into Sandbox?

#### Step 1:

Go to alphabetical list of all cran r-project packages at [cran web page](https://cran.r-project.org/web/packages/available_packages_by_name.html)

#### Step 2:

Find your R package and click the package name to open the package page. For example, [Reticulate package](https://cran.r-project.org/web/packages/reticulate/index.html)

#### Step 3:

Load the package to your local machine (from Package source line, red arrow in Figure 1)

1. Fig 1)

   ![](https://lh3.googleusercontent.com/CXH0D1WWwEsxrOoV8NdqmMt3lnyaN6l8ycXkRzQ2QJ75DktfhF8QUkXGsWvAUsGNVRFshz7Sejz2Dr-N6coB1k90ZJOzz7xVQcQbXgN58wmibJ9u36lwP3p0OHQVCWKfXH9PYrE=s0)

#### Step 4:

Check if all dependences (green arrow) are already in your Sandbox

#### Step 5:

Open RStudio and type

`ListOfPackages = library()$results[,1]`

#### Step 6:

Then go through all dependences (indicated by green arrow in Figure 1) to check if they are already found.

'`Name_of_package' %in% ListOfPackages`Example: `'Matrix' %in% ListOfPackages`

#### Step 7:

If the package is found, R returns TRUE. If not, R returns FALSE.

#### Step 8:

If dependences are not found load them to your local machine as well.

#### Step 9:

After you have R packages you need on your local machine, load them to FinnGen green bucked by follow uploading instructions in section “[How to upload to your own IVM via /finngen/green](https://docs.finngen.fi/working-in-the-sandbox/quirks-and-features/how-to-upload-to-your-own-ivm-via-finngen-green)”.

#### Step 10:

Install your packages. In Sandbox RStudio console or in R type

`install.packages("/finngen/green/reticulate_1.20.tar.gz ", 'path/to_your_gnu_library_folder', repos = NULL, type="source")`

#### Step 11:

You can check the name and path of your gnu library folder with your file manager. It is something like /home/ivm/R/x86\_64-pc-linux-gnu-library/4.1.

#### Step 12:

That’s it. You can now call your library in R / RStudio as usual, e.g. at the console: `library(reticulate)`
