\HeaderA{bubble}{Create a bubble plot of spatial data}{bubble}
\keyword{dplot}{bubble}
\begin{Description}\relax
Create a bubble plot of spatial data, with options for bicolour
residual plots (xyplot wrapper)
\end{Description}
\begin{Usage}
\begin{verbatim}
bubble(obj, zcol = 1, ..., fill = TRUE, maxsize = 3, do.sqrt = TRUE, pch, 
        col = c(2,3), key.entries = quantile(data[,zcol]), main, 
        identify = FALSE, labels = row.names(data.frame(obj)), key.space = "right")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{obj}] object of, or extending, class SpatialPointsDataFrame 
or SpatialGridDataFrame, see \LinkA{coordinates}{coordinates} or \LinkA{SpatialPointsDataFrame}{SpatialPointsDataFrame}; 
the object knows about its spatial coordinates
\item[\code{zcol}] z-variable column name, or column number after removing
spatial coordinates from x@data: 1 refers to the first non-coordinate
column 
\item[\code{fill}] logical; if TRUE, filled circles are plotted (pch = 16), 
else open circles (pch = 1); the pch argument overrides this 
\item[\code{maxsize}] \code{cex} value for largest circle 
\item[\code{do.sqrt}] logical; if TRUE the plotting symbol area (sqrt(diameter)) 
is proportional to the value of the z-variable; if FALSE, the symbol size
(diameter) is proportional to the z-variable 
\item[\code{pch}] plotting character 
\item[\code{col}] colours to be used; numeric vector of size two: first value
is for negative values, second for positive values. 
\item[\code{key.entries}] the values that will be plotted in the key; by default 
the five quantiles min, q.25, median q.75, max 
\item[\code{main}] main plotting title 
\item[\code{identify}] logical; if true, regular \code{plot} is called instead of
\code{xyplot}, and followed by a call to \code{identify()}. 
\item[\code{labels}] labels argument passed to \code{plot} if \code{identify}
is TRUE 
\item[\code{...}] arguments, passed to \code{xyplot}, or \code{plot} if 
identification is required. 
\item[\code{key.space}] location of the key
\end{ldescription}
\end{Arguments}
\begin{Value}
returns (or plots) the bubble plot; if \code{identify} is TRUE, returns
the indexes (row numbers) of identified points.
\end{Value}
\begin{Author}\relax
Edzer J. Pebesma
\end{Author}
\begin{References}\relax
\end{References}
\begin{SeeAlso}\relax
\LinkA{xyplot}{xyplot}, \LinkA{mapasp}{mapasp}, \LinkA{identify}{identify}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(meuse)
coordinates(meuse) <- c("x", "y") # promote to SpatialDataFrame
bubble(meuse, "cadmium", maxsize = 2.5, main = "cadmium concentrations (ppm)", 
    key.entries = 2^(-1:4))
bubble(meuse, "zinc", main = "zinc concentrations (ppm)",
    key.entries =  100 * 2^(0:4))
\end{ExampleCode}
\end{Examples}

