# Installing and setting up R

R is a language and environment for statistical computing.  It is a
variant of S, a language for statistical computing originally developed 
at AT&T Bell Labs.

## The case for R

- Open soure, transparent algorithms
- Reproducible data analysis
- Free of cost
- Rich package ecosystem
- Extensible by user
  
## Installing R

To install R go to [CRAN](https://cran.r-project.org/).  Select the
link for your operating system and choose the latest release (4.0.2).

## RStudio

Most people will want to use an IDE (Integrated Development
Environment), and the best option is
[RStudio](https://www.rstudio.com/products/rstudio/download/#download).
You need to have R installed before you download RStudio.  You can export 
documents in HTML, PDF, and other formats.

## Jupyter

Some people will find it easier to learn via
[Jupyter](https://jupyter.org/) which is another IDE.  The [installation instructions](https://nbviewer.jupyter.org/urls/senresearch.github.io/bioe805/assets/lectures/29-apndx-jupyter.ipynb) 
are more involved, but worth it. With Jupyter you 
can interact with your code in the browser, and some will find this very 
convenient.  You can also work in other languages such as Python and Julia
using Jupyter. 

## Editors

It is also helpful to have some text editors for editing code or plain
text data files.  If you are only coding in R, the RStudio editor is
fine, and may be all that you need.  If you are coding in multiple
languages (e.g. Python, C++, and R), you might want to use an editor
you can use for all coding, not just R.

Three choices:

- [Sublime Text](https://www.sublimetext.com/)
- [Emacs](https://www.gnu.org/software/emacs/)
- [Vim](https://www.vim.org/download.php)
