GoogleMapsPlot(mydata, latitude = "latitude", longitude = "longitude", type = "default", xlim, ylim, pollutant = NULL, labels = NULL, cols = "default", limits = c(0, 100), cex = pollutant, pch = NULL, cex.range = c(2, 10), xlab = longitude, ylab = latitude, main = "", axes = TRUE, map = NULL, map.raster = TRUE, map.cols = NULL, aspect = NULL, as.table = TRUE, plot.type = "xy", plot.transparent = FALSE, key = NULL, key.position = "right", key.header = "", key.footer = pollutant, auto.text = TRUE, ...)
GoogleMapsPlot
plot.mydata
giving the latitudes and longitudes, respectively, of measurements.
If only one latitude longitude pair are supplied, the function applies
a default range to the plot. To override this either set the required range
using xlim
and ylim
(see below) or the map zoom
level. (Note: The default is equivalent to zoom = 15
.)type
to the name of another variable in
mydata
, in which case the plotted data will be divided into
quantiles based on that data series. See cutData
for
further details.(NOTE: type conditioning currently allows up to
two levels of conditioning, e.g., type = c("weekday",
"daylight")
.)latitude
and longitude
,
but can be forced as part of the plot call. (NOTE: This are
in-development and should be used with care. The RgoogleMaps
argument size = c(640, 640)
can be use to force map
dimensions to square.)mydata
that is to be evaluated at the each measurement
point. Depending on settings, nominally cols
and
cex
, the evaluation can be by colour, size or both.mydata
column/field
containing the labels to be used or a list, containing that field name
(as labels
), and any other label properties, e.g. cex
,
col
, etc, required for fine-tuning label appearance.cols
is passed to openColours
for evaluation, but can be
forced to one colour using e.g. col = "red"
. The special case
cols = "greyscale"
forces all plot components (the map, the data
layer and the plot strip of type
conditioning) to greyscale for
black and white printing. See ?openColours
for more details.limits
can be set in the form
c(lower, upper)
to modify the colour range.NULL
or pollutant
if supplied. If NULL
all points
are plotted an equal size. If pollutant
or the name of another
variable in mydata
this is used by scaled using cex.range
.
If necessary, cex
can also be forced, e.g. cex = 1
to make
all points the same size.pch = 20
), but can be any predefined symbol,
e.g. pch = 1
is the open circle symbol used in most standard R
plots. pch
may also be the name of a variable in mydata
for
local control.cex
values to if cex
is
supplied as a mydata
variable name. This is intended to provide
sensible data point points regardless of the variable value range but may
be require fine-tuning.quickText
to handle
formatting if enabled (auto.text = TRUE
). By default
GoogleMapsPlot
uses latitude
and longitude
names as
xlab and ylab, respectively.TRUE
/FALSE
) all x and y axis annotation and labelling.RgoogleMaps
output, to be used as a
background map. If NULL
(as in default), a map is produced using
the RgoogleMaps-package
function MapBackground
, the supplied
latitude
and longitude
ranges, and any additional
RgoogleMaps-package
arguments supplied as part of the plot call. (Note:
the map
object currently used in panel...
functions is a
modified form of this output, details to be confirmed.)TRUE
uses panel.GoogleMapsRaster
to produce the map layer,
while the alternative (FALSE
) uses panel.GoogleMaps
. (NOTE:
The raster version is typically much faster but may not be available for
all computer systems.)cols
a colour scale, but, if supplied, used to
recolour the map layer before plotting. (NOTE: If set, this will override
cols = "greyscale"
.)NULL
(default), this
is calculated by the function based on the data and xlim
and
ylim
ranges.as.table
is a lattice
option that controls
the order in which multiple panels are displayed. The default
(TRUE
) produces layouts similar to other openair plot.plot.type = "xy"
), this is an x-y style scatter plot,
but can also be other pre-defined options (e.g. "level" for a levelplot)
or a user-defined panel of a similar structire to panel...
functions in lattice
.TRUE
applying default 0.5). Note: User-defined colours
(and some panel defaults when supplying specialist functions using e.g.
plot.type = panel...
) may sometimes supersede this option.key =
NULL
) the key is generated is a colour range exists, but can be forced
(key = TRUE/FALSE
) or controlled at a higher level (via
drawOpenKey
)."top"
, "right"
,
"bottom"
and "left"
.auto.text = TRUE
), these arguments are
passed to the scale key (drawOpenKey
) via quickText
to
handle formatting.auto.text = TRUE
allows labels (xlab
, ylab
, main
, etc.) to be passed
to the plot via quickText
. auto.text = FALSE
turns this
option off and passes labels to the plot without modification.cutData
for type
handling, MapBackground
in RgoogleMaps
for map layer
production, and xyplot
in lattice
for data layer
production.GoogleMapsPlot
also
returns an object of class ``openair''. The object includes three main
components: call
, the command used to generate the plot;
data
, the data frame of summarised information used to make the
plot; and plot
, the plot itself. If retained, e.g. using
output <- GoogleMapsPlot(mydata)
, this output can be used to
recover the data, reproduce or rework the original plot or undertake
further analysis.An openair output can be manipulated using a number of generic operations,
including print
, plot
and summary
.
GoogleMapsPlot
is an IN DEVELOPMENT function.It combines a dedicated map layer, e.g. panel.GoogleMaps
, or
(the default) panel.GoogleMapsRaster
, and standard
lattice
panels such as panel.xyplot
or
panel.levelplot
as a data layer, to produce
map-based data visualisations.
It provides lattice-style conditioning/handling for
RgoogleMaps
outputs.
RgoogleMaps: Markus Loecher and Sense Networks (2011). RgoogleMaps: Overlays on Google map tiles in R. R package version 1.1.9.6. http://CRAN.R-project.org/package=RgoogleMaps
lattice: Sarkar, Deepayan (2008) Lattice: Multivariate Data Visualization with R. Springer, New York. ISBN 978-0-387-75968-5
RgoogleMaps
,
xyplot
, panel.xyplot
and
panel.levelplot