Chapter 11 Interpolation with Array of Things Data

11.1 Overview

This workshop continues teaching interpolation in R using Array of Things data. This is based on Part 2 of the Array of Things workshop put together by Marynia Kolak at the CSDS.

11.2 Download data

Please download data for this workshop by going to the following link and right-clicking on “Raw”, then saving the link as a CSV on your computer.

Or, you can run the following code in your console:

download.file("https://github.com/spatialanalysis/workshop-notes/raw/master/data/node_temps.csv", destfile = "node-temps.csv")

Also download a copy of the Chicago Community Area data here, or use the API Endpoint (copy and paste into your console).

library(sf)
areas <- st_read("https://data.cityofchicago.org/resource/igwz-8jzy.geojson")
## Reading layer `igwz-8jzy' from data source `https://data.cityofchicago.org/resource/igwz-8jzy.geojson' using driver `GeoJSON'
## Simple feature collection with 77 features and 9 fields
## geometry type:  MULTIPOLYGON
## dimension:      XY
## bbox:           xmin: -87.94011 ymin: 41.64454 xmax: -87.52414 ymax: 42.02304
## epsg (SRID):    4326
## proj4string:    +proj=longlat +datum=WGS84 +no_defs

Challenge

Read in the csv as an sf object, then explore it using exploratory data functions like head(), str(), summary(), and plot()

Challenge

Try making a map of the nodes, with the community areas, using ggplot2.

Challenge

Convert the sf object into an sp object. Hint: as_Spatial(sf) should do the trick.

Challenge

Make an empirical variogram of the data.

Challenge

Krige! Try out a few types of models: spherical, exponential, and linear.