Usage
spplot1(x, what, palette = brewer.pal(5, "Oranges"), breaks = NULL,
legpos = "topleft", fun = identity, include.lowest = TRUE, bty = "n",
bg = NULL, printlegend = TRUE, bw = FALSE, useLeaflet = FALSE,
urltemplate = urlTemplate("Stamen_Toner"), fillOpacity = 0.5,
legendOpacity = 0.5, OSMbg = NULL, leafletLegend = TRUE, ...)Arguments
x
a SpatialPolgonsDataFrame or a SpatialPointsDataFrame
what
the name of the variable to plot
palette
the palette, can either be a vector of names of colours, or a vector of colours produced for example by the brewer.pal function.
breaks
optional breaks for the legend, a vector of length 1 + length(palette)
legpos
the position of the legend, options are 'topleft', 'topright', 'bottomleft', 'bottomright'
fun
an optional function of the data to plot, default is the identity function
printlegend
logical: print the legend?
bw
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.
useLeaflet
whether to use leaflet to produce a zoomable map this requires the leaflet package, available by issuing the command "devtools::install_github('rstudio/leaflet')"
urltemplate
template for leaflet map background, default is urlTemplate('Stamen-Toner'), but any valid web address for leaflet templates will work here. See ?urlTemplate.
fillOpacity
see ?addPolygons
legendOpacity
see opacity argument in function addLegend
OSMbg
optional OpenStreetMap background to add to plot, obtain this using the function getBackground
leafletLegend
logical, display the leaflet legend?
...
other arguments to be passed to plot