Introduction To R
Introduction To R
2/11
· IHAKA, R. R : Past and Future History. http://cran.r-
project.org/doc/html/interface98-paper/paper.html
· R provides a wide variety of statistical (linear and nonlinear modelling,
classical statistical tests, time-series analysis, classification, clustering, …)
and graphical techniques, and is highly extensible.
· R is an integrated suite of software facilities for data manipulation,
calculation and graphical display.
· For computationally-intensive tasks, C, C++ and Fortran code can be linked
and called at run time
3/11
Installing R
· https://www.r-project.org/
· The Comprehensive R Archive Network - CRAN: it is available at several
URLs (mirrors). It is recommended that we choose a closer location
https://cran.r-project.org/mirrors.html
· It can be found the same materials, R versions, extensions and documents
on each mirror
· When we install R, we are installing only a “core” and the Base packages. If
we want to use other packages, it is necessary to install and load the
package
4/11
R Packages
· R Base Packages: it is install together with R. This package contains the
basic functions which let R function as a language: arithmetic,
input/output, basic programming support, etc. Its contents are available
through inheritance from any environment.
· Examples of R Base Packages: base, datasets, graphics and stats
· A complete list of functions can be view by typing
library(help = "base")
5/11
R Packages
· Other packages: recommended and contributed
· Recommended packages: MASS, lattice, nlme, rpart, survival, spatial
· Contributed packages: 19,260 packages (Feb 27, 2023 - 4:52pm)
· Available packages: any mirror
· Installed and loaded packages
installed.packages()
search()
6/11
R Packages
· To install a package: install.packages("package name") or menu
shortcuts.
library("tidyverse")
7/11
Citing R and R packages
· Citing R and R packages: it is needed to cite
· to cite R:
citation()
citation("ggplot2")
8/11
Needs help?
· Books
· Handouts
· R Documentation: Contributed documentation + mailing lists
· Functions help
· Google
· Stackoverflow: you can restrict your search by using [R]
(https://stackoverflow.com/)
· Short reference card, reference guides…
9/11
RStudio
· IDE: Integrated Development Environment for R
· It includes a console, syntax-highlighting editor that supports direct code
execution, as well as tools for plotting, history, debugging and workspace
management
· It is available in open source and commercial editions
· It runs on the desktop (Windows, Mac, and Linux) or in a browser
connected to RStudio Server or RStudio Workbench
· more complete and “user-friendly” interface
· It can be downloaded from http://www.rstudio.com/ and it must be install
in computers that already have the R installed
10/11
References
HORNIK, K. (2018), The R FAQ. https://CRAN.R-project.org/doc/FAQ/R-FAQ.html
11/11