| 1 |
\name{bubble} |
| 2 |
\alias{bubble} |
| 3 |
\title{ |
| 4 |
Create a bubble plot of spatial data |
| 5 |
} |
| 6 |
\description{ |
| 7 |
Create a bubble plot of spatial data, with options for bicolour |
| 8 |
residual plots (xyplot wrapper) |
| 9 |
} |
| 10 |
\usage{ |
| 11 |
bubble(obj, zcol = 1, ..., fill = TRUE, maxsize = 3, do.sqrt = TRUE, pch, |
| 12 |
col = c("#d01c8b", "#4dac26"), key.entries = quantile(data[,zcol]), main, |
| 13 |
identify = FALSE, labels = row.names(data.frame(obj)), key.space = "right", |
| 14 |
scales = list(draw = FALSE), xlab = NULL, ylab = NULL, panel = panel.bubble, |
| 15 |
sp.layout = NULL, |
| 16 |
xlim = bbexpand(bbox(obj)[1,], 0.04), |
| 17 |
ylim = bbexpand(bbox(obj)[2,], 0.04)) |
| 18 |
} |
| 19 |
\arguments{ |
| 20 |
\item{obj}{ object of, or extending, class SpatialPointsDataFrame |
| 21 |
or SpatialGridDataFrame, see \link{coordinates} or \link{SpatialPointsDataFrame}; |
| 22 |
the object knows about its spatial coordinates} |
| 23 |
\item{zcol}{ z-variable column name, or column number after removing |
| 24 |
spatial coordinates from x@data: 1 refers to the first non-coordinate |
| 25 |
column } |
| 26 |
\item{fill}{ logical; if TRUE, filled circles are plotted (pch = 16), |
| 27 |
else open circles (pch = 1); the pch argument overrides this } |
| 28 |
\item{maxsize}{ \code{cex} value for largest circle } |
| 29 |
\item{do.sqrt}{ logical; if TRUE the plotting symbol area (sqrt(diameter)) |
| 30 |
is proportional to the value of the z-variable; if FALSE, the symbol size |
| 31 |
(diameter) is proportional to the z-variable } |
| 32 |
\item{pch}{ plotting character } |
| 33 |
\item{col}{ colours to be used; numeric vector of size two: first value |
| 34 |
is for negative values, second for positive values. Default colors: |
| 35 |
5-class PiYG from colorbrewer.org. } |
| 36 |
\item{key.entries}{ the values that will be plotted in the key; by default |
| 37 |
the five quantiles min, q.25, median q.75, max } |
| 38 |
\item{main}{ main plotting title } |
| 39 |
\item{identify}{ logical; if true, regular \code{plot} is called instead of |
| 40 |
\code{xyplot}, and followed by a call to \code{identify()}. } |
| 41 |
\item{labels}{ labels argument passed to \code{plot} if \code{identify} |
| 42 |
is TRUE } |
| 43 |
\item{...}{ arguments, passed to \code{xyplot}, or \code{plot} if |
| 44 |
identification is required. } |
| 45 |
\item{key.space}{location of the key} |
| 46 |
\item{scales}{scales argument as passed to \link[lattice]{xyplot}} |
| 47 |
\item{xlab}{x-axis label} |
| 48 |
\item{ylab}{y-axis label} |
| 49 |
\item{panel}{panel function used} |
| 50 |
\item{sp.layout}{possible layout items; see \link{spplot}} |
| 51 |
\item{xlim}{x axis limit} |
| 52 |
\item{ylim}{y axis limit} |
| 53 |
} |
| 54 |
\value{ |
| 55 |
returns (or plots) the bubble plot; if \code{identify} is TRUE, returns |
| 56 |
the indexes (row numbers) of identified points. |
| 57 |
} |
| 58 |
%\references{ } |
| 59 |
\author{ Edzer Pebesma } |
| 60 |
\seealso{\link[lattice]{xyplot}, \link{mapasp}, \link{identify}} |
| 61 |
\examples{ |
| 62 |
data(meuse) |
| 63 |
coordinates(meuse) <- c("x", "y") # promote to SpatialPointsDataFrame |
| 64 |
bubble(meuse, "cadmium", maxsize = 2.5, main = "cadmium concentrations (ppm)", |
| 65 |
key.entries = 2^(-1:4)) |
| 66 |
bubble(meuse, "zinc", main = "zinc concentrations (ppm)", |
| 67 |
key.entries = 100 * 2^(0:4)) |
| 68 |
} |
| 69 |
\keyword{dplot} |