Chapter 11
Space-time datasets are indexed both in space and in time. The data may consist of a spatial vector object (for example, points or polygons) or raster data at different times. The first case is representative of data from fixed sensors providing measurements abundant in time but sparse in space. The second case is the typical format of satellite imagery, which produces high spatial resolution data sparse in time (E. Pebesma 2012).
There are several visualization approaches of space-time data trying to cope with the four dimensions of the data (Cressie and Wikle 2011).
On the one hand, the data can be conceived as a collection of snapshots at different times. These snapshots can be displayed as a sequence of frames to produce an animation, or can be printed on one page with different panels for each snapshot using the small-multiple technique described repeatedly in previous chapters.
On the other hand, one of the two spatial dimensions can be collapsed through an appropriate statistic (for example, mean or standard deviation) to produce a space-time plot (also known as a Hovmöller diagram). The axes of this graphic are typically longitude or latitude as the x-axis, and time as the y-axis, with the value of the spatial-averaged value of the raster data represented with color.
Finally, the space-time object can be reduced to a multivariate time series (where each location is a variable or column of the time series) and displayed with the time series visualization techniques described in the Part I. This approach is directly applicable to space-time data sparse in space (for example, point measurements at different times). However, it is mandatory to use aggregation in the case of raster data. In this case, the multivariate time series is composed of the evolution of the raster data averaged along a certain direction.
The next chapters, focused on raster space-time data (Chapter 12) and point space-time data (Chapter 13), illustrate with examples how to produce animations, multipanel graphics, hovmöller diagrams, and time-series with R.
The CRAN Tasks View “Handling and Analyzing Spatiotemporal Data”1 summarizes the packages for reading, vizualizing, and analyzing spacetime data. This section provides a brief introduction to the spacetime, raster, and rasterVis packages. Most of the information has been extracted from their vignettes, webpages, and help pages. You should read them for detailed information.
The spacetime package (E. Pebesma 2012) is built upon the classes and methods for spatial data from the sp package, and for time series data from the xts package. It defines classes to represent four space-time layouts:
Moreover, spacetime provides several methods for the following classes:
The raster package (R. J. Hijmans 2013) is able to add time information associated with layers of a RasterStack or RasterBrick object with the setZ function. This information can be extracted with getZ.
If a Raster* object includes this information, the zApply function can be used to apply a function over a time series of layers of the object.
rasterVis (Oscar Perpiñán and R. Hijmans 2013) provides three methods to display spatiotemporal rasters:
On the other hand, the histogram, densityplot, and bwplot methods accept a FUN argument to be applied to the z slot of Raster* object (defined by setZ). The result of this function is used as the grouping variable of the plot to create different panels.
1 http://cran.r-project.org/web/views/SpatioTemporal.html