A function to compare two SpatialPolgonsDataFrame or SpatialPointsDataFrame objects using a unified legend for the variable of interest in both
spplot_compare(
x,
y,
what,
what1 = what,
palette = brewer.pal(9, "Oranges"),
legpos = "topleft",
border = NA,
fun = identity,
t1 = "",
t2 = "",
bw = FALSE,
...
)
produces a plot comparing x[[what]] and y[[what1]]
a SpatialPolgonsDataFrame or a SpatialPointsDataFrame
a SpatialPolgonsDataFrame or a SpatialPointsDataFrame
the name of the variable from x to plot
the name of the variable from y to plot. default is to plot the variable of the same name
the palette, can either be a vector of names of colours, or a vector of colours produced for example by the brewer.pal function.
the position of the legend, options are 'topleft', 'topright', 'bottomleft', 'bottomright'
see ?spplot
an optional function of the data to plot, default is the identity function
title for the plot of x
title for the plot of y
Logical. Plot in black/white/greyscale? Default is to produce a colour plot. Useful for producing plots for journals that do not accept colour plots.
other arguments to be passed to the plot function