Skip to content

Commit 2541d97

Browse files
committed
fix #21
1 parent fa3d9cd commit 2541d97

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

docs/00-introduction.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,37 @@ order specified in the help manual for each function (see [Getting help with R](
419419
```
420420

421421

422+
## Libraries and packages
422423

424+
All functions in R sit within a package. Many packages come natively with RStudio, such as `stats`, `base` and `utils`. These are loaded automatically when you start R, so their functions are always available.
425+
426+
One of R's greatest strengths is its huge ecosystem of community-contributed
427+
packages that extend what R can do. To use one of these packages, you need to:
428+
429+
Step 1. **Install it once** — this downloads the package to your computer:
430+
431+
(Here on the REANNZ environment, we have already installed all the packages you need for this workshop)
432+
433+
434+
!!! r-project "r"
435+
436+
```r
437+
install.packages("ggplot2")
438+
```
439+
440+
441+
Step 2. **Load it each session** — this makes the package's functions available in your
442+
current R session:
443+
444+
!!! r-project "r"
445+
446+
```r
447+
library(ggplot2)
448+
```
423449

424450
We will discuss more on where to look for the libraries and packages
425451
that contain functions you want to use. For now, be aware that two
426-
important ones are:
452+
important online repositories are:
427453

428454
* [CRAN](https://cran.r-project.org/), the main repository for R
429455
* [Bioconductor](http://bioconductor.org/), a popular repository for

0 commit comments

Comments
 (0)