author: "Carine Rey [carine.rey@ens-lyon.fr](mailto:carine.rey@ens-lyon.fr), Laurent Modolo [laurent.modolo@ens-lyon.fr](mailto:laurent.modolo@ens-lyon.fr)"
date: "2021"
output:
rmdformats::downcute:
self_contain: true
use_bookdown: true
default_style: "dark"
lightbox: true
css: "../src/style.css"
---
```{r setup, include=FALSE}
rm(list=ls())
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(comment = NA)
```
```{r klippy, echo=FALSE, include=TRUE}
klippy::klippy(
position = c('top', 'right'),
color = "white",
tooltip_message = 'Click to copy',
tooltip_success = 'Copied !')
```
If you need to install a package that is not available on the CRAN but on a github repository, you can do it using the "remotes" package. Indeed this package imports functions that will allow you to install a package available on [github](https://github.com/) or bitbucket or gitlab directly on your computer.
To use the "remotes" packages, you must first install it:
```R
install.packages("remotes")
```
Once "remotes" is installed, you will be able to install all R package from github or from their URL.
For example, if you want to install the last version of a "gganimate", which allow you to animate ggplot2 graphes, you can use :
```R
remotes::install_github("thomasp85/gganimate")
```
By default the latest version of the package is installed, if you want a given version you can specify it :
@@ -491,6 +491,7 @@ Instead we are going to use the Rstudio code editor panel, to write our code.
You can go to **File > New File > R script** to open your editor panel.

## Writing function
We can define our own function with :
...
...
@@ -719,6 +720,8 @@ To install packages from [Bioconducor](http://www.bioconductor.org) and [github]
## Installing packages
### From CRAN
To install packages, you can use the `install.packages` function (don't forget to use tabulation for long variable names).
```R
...
...
@@ -740,6 +743,49 @@ install.packages("ggplot2")
</p>
</details>
### From Bioconducor
To install packages from [bioconductor](http://www.bioconductor.org) you must first install a package called "BiocManager".
This package imports a function called "install" allowing you to install packages hosted in bioconductor from their name.
To install "BiocManager" you must type:
```R
install.packages("BiocManager")
```
Then to install, for example "tximport", you just have to write:
```R
BiocManager::install("tximport")
```
### From github
If you need to install a package that is not available on the CRAN but on a github repository, you can do it using the "remotes" package. Indeed this package imports functions that will allow you to install a package available on [github](https://github.com/) or bitbucket or gitlab directly on your computer.
To use the "remotes" packages, you must first install it:
```R
install.packages("remotes")
```
Once "remotes" is installed, you will be able to install all R package from github or from their URL.
For example, if you want to install the last version of a "gganimate", which allow you to animate ggplot2 graphes, you can use :
```R
remotes::install_github("thomasp85/gganimate")
```
By default the latest version of the package is installed, if you want a given version you can specify it :