Learn R Programming

plotGoogleMaps (version 2.2)

stfdfGoogleMaps: Create a plot of spacetime (STFDF) data on Google Maps

Description

Plot htm output with Google Maps API and a plot of spacetime (STFDF) data as a combination of users' data and Google Maps layers. Ready to use as local htm file or into your own website.

Usage

stfdfGoogleMaps(stfdf, zcol=1, filename='', layerName="", plotNames=row.names(stfdf@sp), aggregateFUN='mean', round.att=1, plot.height=300, plot.width=300, ...)

Arguments

stfdf
object of spacetime (STFDF-class) with associated coordinate reference systems
zcol
variable column name, or column number after removing spatial coordinates from x@data: 1 refers to the first non-coordinate column, it has to be numeric
filename
the name of the output htm or html file. If filename is not defined the function creates temporary file.
layerName
the name of the layer. Layer name appears on the check box for switching layer of and on in output htm.
plotNames
vector of of plot titles in infoWindow plots
aggregateFUN
a function to compute the summary statistics of time series
round.att
integer indicating the number of decimal places for ploting attribute, if not a number no round
plot.height
the height of of plot in infoWindow plot in pixels (px)
plot.width
the width of plot in infoWindow plot in pixels (px)
...
arguments from plotGoogleMaps

Value

See Also

stplotGoogleMaps, plotGoogleMaps

Examples

Run this code
## Data preparation
## STFDF data from spacetime vignette spacetime: Spatio-Temporal Data in R 
#library("maps")
# states.m = map('state', plot=FALSE, fill=TRUE)
# IDs <- sapply(strsplit(states.m$names, ":"), function(x) x[1])
# library("maptools")
#states = map2SpatialPolygons(states.m, IDs=IDs)
#yrs = 1970:1986
#time = as.POSIXct(paste(yrs, "-01-01", sep=""), tz = "GMT")
# library("plm")
#data("Produc")
#Produc.st = STFDF(states[-8], time, Produc[order(Produc[2], Produc[1]),])
#Produc.st@sp@proj4string=CRS('+proj=longlat +datum=WGS84')
# m <-  stfdfGoogleMaps(Produc.st, zcol= 'unemp')               

Run the code above in your browser using DataLab