Robin Lovelace
Newcastle, June 2nd 2015
This course is brought to you the Consumer Data Research Centre (CDRC), a project based at the University of Leeds and UCL. It is funded by the ESRC’s (Big Data Network)
pkgs <- c("rgdal", # (can be tricky)
"rgeos",
"ggmap",
"tmap",)
install.packages(pkgs)
During this course we will cover these topics
After that: you choose!
“With the advent of “modern” GIS software, most people want to point and click their way through life. That’s good, but there is a tremendous amount of flexibility and power waiting for you with the command line. Many times you can do something on the command line in a fraction of the time you can do it with a GUI (Sherman 2008, p. 283)
It can take data in a wide range of formats. E.g. MySQL database dump gives you this:
LINESTRING(-1.81 52.55,-1.81 52.55, … ) - solved:
ps <- as.list(ps) # make a list
for(i in 1:length(ps)){
ps[[i]] <- gsub("LINESTRING\\(", "", ps[[i]])
ps[[i]] <- gsub("\\)", "", ps[[i]])
ps[[i]] <- gsub(" ", ",", ps[[i]])
ps[[i]] <- matrix(ps[[i]], ncol=2, byrow=T)
ps[[i]] <- Line(ps[[i]])
}
And if you get stuck? Just ask!
Example: I could not load a MultiFeature GeoJSON. So I asked: http://stackoverflow.com/q/29066198/1694378
If you cannot visualise your data, it is very difficult to understand your data. Conversely, visualisation will greatly aid in communicating your results.
Human beings are remarkably adept at discerning relationships from visual representations. A well-crafted graph can help you make meaningful comparisons among thousands of pieces of information, extracting patterns not easily found through other methods. … Data analysts need to look at their data, and this is one area where R shines. (Kabacoff, 2009, p. 45).
Flexibility of ggplot2 - see robinlovelace.net
Before progressing further: Any questions?
Course materials are all available online from a GitHub repository. Click “Download ZIP” to download all the test data, ready to procede.
The main document to accompany this tutorial is a pdf within the main repository. This is to be made available for free worldwide - any comments/corrections welcome.