Usage
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, ...)
Arguments
mydata
The openair data frame to use to generate the
GoogleMapsPlot
plot.
latitude,longitude
The names of the data series in 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
type
The type of data conditioning to apply before
plotting. The default is will produce a single plot using the
entire data. Other type options include hour (for hour of
the day), weekday (for day of the week) and
xlim,ylim
The x-axis and y-axis size ranges. By default
these sized on the basis of 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
argume
pollutant
If supplied, the name of a pollutant or variable
in 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.
labels
If supplied, either the name of 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
cols
The colour set to use to colour scaled data. Typically,
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
limits
By default, the data colour scale is fitted to the total data
range. However, there are circumstances when the user may wish to set
different ones. In such cases limits
can be set in the form
c(lower, upper)
to modify the colo
cex
The size of data points plotted on maps. By default this
NULL
or pollutant
if supplied. If NULL
all points
are plotted an equal size. If pollutant
or the name of another
variable in mydata
pch
The plot symbol to be used when plotting data. By default this
is a solid circle (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
cex.range
The range to rescale 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.
xlab,ylab,main
The x-axis, y-axis and main title labels to be added
to the plot. All labels are passed via quickText
to handle
formatting if enabled (auto.text = TRUE
). By default
GoogleMapsPlot
uses latitude
and
axes
An alternative (short hand) option to add/remove
(TRUE
/FALSE
) all x and y axis annotation and labelling.
map
If supplied, an 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
map.raster
Should the map be plotted as a raster object? The default
TRUE
uses panel.GoogleMapsRaster
to produce the map layer,
while the alternative (FALSE
) uses panel.GoogleMaps
. (NOTE:
The raster version is t
map.cols
Like cols
a colour scale, but, if supplied, used to
recolour the map layer before plotting. (NOTE: If set, this will override
cols = "greyscale"
.)
aspect
The aspect ratio of the plot. If NULL
(default), this
is calculated by the function based on the data and xlim
and
ylim
ranges.
as.table
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
The method to use to produce the data layer for the plot.
By default (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 struc
plot.transparent
Data layer transparency control. When enabled, this
forces colours used in the data layer to transparent, and can be a
numeric setting the colour density, from invisible (0) to solid (1), or a
logical (TRUE
applying default 0.5). Note: Use
key
Fine control for the color scale key. By default (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
).
key.position
Location where the scale key should be plotted.
Allowed arguments currently include "top"
, "right"
,
"bottom"
and "left"
.
key.header,key.footer
Header and footer labels to add to colour key,
if drawn. If enabled (auto.text = TRUE
), these arguments are
passed to the scale key (drawOpenKey
) via quickText
to
handle formatting.
auto.text
Automatic routine text 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 an
...
Addition options are passed on to cutData
for type
handling, MapBackground
in RgoogleMaps
for map layer
production, and xyplot
in lattice
for data layer
production.