Download presentation
Presentation is loading. Please wait.
1
Crash course in R – short introduction
Dag Hjermann & Susi Schneider, NIVA Forfatternavn
2
Installing R Hopefully already done Otherwise:
cran.r-project.org find …. You may in addition install Rstudio Nice window layout Many practical features Is also based on coding Forfatternavn
3
R interface Command window Forfatternavn
4
Script window (can be saved as a file)
R interface Command window (cannot be saved) Script window (can be saved as a file) Forfatternavn
5
Running commands: 1 – in command window
Script window Write commands Run using“Enter” button If you make an error, use “up arrow” and correct it Command window Forfatternavn
6
Running commands: 2 – in script window
Write commands Push “Ctrl + R” Command window Forfatternavn
7
R vs. Excel: Opening a file
Forfatternavn
8
R vs. Excel: calculating new variable
Forfatternavn
9
Getting help in R «?» method Forfatternavn
10
Getting help in R Google method
11
Packages R has built-in commands for simple statistics and graphs
Additional functions are in packages Each package contains (usually) several functions (and often example data) Ca packages can be found on cran.r-project.org Each package only has to be installed once (are stored on your computer) The packages you need must be loaded each time you start R Forfatternavn
12
Installing libraries – common problem
R tries to install package in protected folder «Do you want to use a personal library instead» Say «no» Solution Make a new folder on C:, example C:/R In R, write .libpaths(c("c:/R", .libPaths())) This will make R installing new libraries in this folder Forfatternavn
13
Introductions to R on internet
rforcats.net
14
Introductions to R on internet
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.