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

Description Usage Arguments Value Author(s) See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

This function returns a html(htm) file ready to use.

Author(s)

Milan Kilibarda <kili@grf.bg.ac.rs>

See Also

stplotGoogleMaps, plotGoogleMaps

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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')               

Example output

Loading required package: sp
Loading required package: spacetime

plotGoogleMaps documentation built on May 1, 2019, 7:29 p.m.