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: 


For Mac: 

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: 

  1. Contact everyone’s favorite search engine: https://www.google.com/
  2. wait for one or two hours and contact https://www.google.com/ again
  3. if you still have not found a solution, contact peter.ranacher@geo.uzh.ch