-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages.qmd
57 lines (33 loc) · 1.77 KB
/
packages.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
title: "Adding Additional Packages in R/Python"
---
## Adding Additional Packages in R/Python
The ADRF has an internal package repository, so users can install packages for R and Python themselves.
The repositories that are currently mirrored in the ADRF are [CRAN](https://cran.r-project.org/) for R packages and [PyPi.org](http://pypi.org/) for Python. There is currently no access to packages hosted on Github or other mirrors.
::: callout-note
If you are working in a shared workspace for a project, each user in the project must install the packages, there is no shared package installation for projects.
:::
## R packages
To install R packages, simply type:
`install.packages("packagename")`
![](images/rinstall.png)
and the package will be installed from the repository. You will not have to re-install the package again, and to use the package load it with the `library()` function. For example:
`library(tidyverse)`
All packages will be installed in your user folder.
To install a specific package version you can specify:
`install.packages("remotes")`
`remotes::install_version("tidyverse", "1.3.2")`
::: callout-note
We recommend starting R using Rstudio for best results, instead of double clicking on a R or Rmarkdown script.
:::
## Python packages
Similar to R packages, Python packages may be installed using the Package Installer for Python (pip).
::: callout-note
We recommend installing python packages from the command line. If you start Jupyter lab, and choose the Terminal tab:
![](images/pythoninstall.png){width="445"}
Then install your package using pip, for example, to install the `pandas` package:
![](images/pip.png)
Then you may use the package within your Jupyter notebook as usual.
:::
To install a specific package version type
`pip install pandas==1.2.3`