There are many packages that already exist or are in active development that support the visualization of spatial data in R. However, there seems to be a gap for those that need to quickly view, compare, and explore the results of a given spatial analysis. The current thinking for quickmapr
is to allow for quick visualization of sp
and raster
objects.
Planned functionality for the first release is for easy mapping of multiple layers, simple zooming, panning, and labelling. These tools are intended for use within an active spatial analysis workflow and not for production quality maps.
quickmapr
is built as a series of wrapper functions for the default sp
plotting functions and currently utilizes either the zoom
packages for zooming and panning or simply re-plots the maps with new x and y limits. Currently there are 8 commands planned. As the idea behind this is to quickly map data, an emphasis was given to brevity of function names. The commands are:
qmap()
: creates the mapzi()
: zooms inzo()
: zooms outze()
: zoom in to an extentp()
: pansl()
: adds labelsi()
: identify featuresf()
: returns to extent of originally created map
Example data are available via:
data(lake)
##Installation This package is not yet on CRAN. To install
install.packages("devtools")
library("devtools")
install_github("jhollist/quickmapr")
library("quickmapr")
##Using Quickmapr (work in progress)
Basic usage of quickmapr
is built around a qmap
object which is simply a list of sp
or raster
objects and a recorded plot. Most of the other quickmpar
functions will work with a qmap
object.
To create a qmap object:
#First some data
data(lake)
#Create your first quick map and object
qm <- qmap(elev,samples,buffer,width)
There are some other options on qmap
that let you change the draw order, coloring of vectors, extent of the map, and whether or not to preform a basic projection check (data are assumed to be in the same coordinate reference system).
So for instance, if you want to zoom in to the extent of one of your layers you could do something like:
#Zoom to the extent of the layer named width
qmap(qm,extent=width)
## qm.elev
## qm.samples
## qm.buffer
## qm.width
Currently this is only working with object in memory and not pulling from the qmap
object.
You can change colors (this is still a bit clunky).
#draw samples and width in red and buffer with blue fill
qmap(qm,order = c(2,4,3), colors = c("red","red","blue"), fill=TRUE)
## qm.elev
## qm.samples
## qm.buffer
## qm.width
## red
## red
## blue
## red