Notes on R
Installation
- go to www.r-project.org
- under 'Getting Started' click on 'download R'
- click on a mirror site
- click on the link for your operating system (OS)
- choose 'install for the first time' (these instructions aren't meant for upgrading!)
- download and save
*.exe
, where * corresponds to your OS
- run
*.exe
- choose no (accept defaults) but add shortcuts
- in Windows, the R executable is
C:\Program Files\R\R-[version]\bin\x64\Rgui.exe
where [version]
is the latest version number and
Rgui
stands for the R graphical user interface
Run R
- if R was successfully installed you should be able to click on the Rgui
- the R window should come up
- type a few commands in the console - they don't have to be syntactically correct!
- to exit from R click File > Exit
- you'll probably not want to 'Save workspace image' but you may want to save the script you may have been running and editing
Install packages
- run R and in the console click on Packages > Install package(s)
- choose a mirror site
- scroll down and select the package you want; e.g.
maps
, then click OK, and the console will report on the installation progress
- to make the package's functions and data available, type
library(maps)
(or the appropriate library), and you should get confirmation messages
- you'll now be able to access the package's functions and data (e.g. if you type
map()
a map of the world should appear)
Lee De Cola
ldecola.net/programs/R/notes.html
2018-09-04