GEO812: Getting started with R for Spatial Analysis
Course in Fall Semester 2019
Download R and RStudio
If you
bring your own computer, we expect you to have R and RStudio up and running on
your machine BEFORE the course. You find the installation guidelines for R
and RStudio below.
For Windows:
-
R: Download
the R binary setup file from the following link: https://cran.r-project.org/bin/windows/base/R-3.6.1-win.exe. Open the file and follow the
on-screen installation guidelines.
- RStudio: Download RStudio for Windows from the following link: https://download1.rstudio.org/desktop/windows/RStudio-1.2.1335.exe. Open the file and follow the on-screen installation guidelines.
For Mac:
-
R: Download
the R .pkg file from the following link: https://cran.r-project.org/bin/macosx/R-3.6.1.pkg. Open the file and follow the
on-screen installation guidelines.
- RStudio: Download RStudio for Mac from the following link: https://download1.rstudio.org/desktop/macos/RStudio-1.2.1335.dmg. Open the file and run RStudio.
Check if your installation was successful
In order to test your installation open RStudio and create a new R script (File -> new File -> R Script). Copy/paste the code below into the blank space, run it (Code -> Run Selected Line(s)) and click on the blue marker:#code start
install.packages("sp")
install.packages("leaflet")
library(sp)
library(leaflet)
irchel<-SpatialPointsDataFrame(data.frame(long=8.549403,lat=47.396653),
data.frame(wcText="irchel"))
content
<- paste(sep = "<br/>",
"<b>You have
succesfully installed R and RStudio!</b>",
"See you soon at GEO
812!")
m <-
leaflet(irchel) %>%
addTiles() %>%
addCircleMarkers(radius=10, opacity =
0.3,popup=content)
m
#code end
In case of problems
If you encounter any problems during your installation, please:
- Contact everyone’s favorite search engine: https://www.google.com/
- wait for one or two hours and contact https://www.google.com/ again
- if you still have not found a solution, contact peter.ranacher@geo.uzh.ch