# NOT RUN {
{
require(raster)
# reference data
sprj <- CRS("+proj=longlat +ellps=WGS84 +no_defs")
moveData <- read.csv(system.file('extdata', 'latlon_example.csv', package="rsMove"))
moveData <- SpatialPointsDataFrame(moveData[,2:3], moveData, proj4string=sprj)
# extract regions
hm <- hotMove(xy=moveData, pxr=0.1, shp=TRUE)
# plot shapefile (color by region)
plot(hm$polygons, col=hm$indices)
# add new information to original shapefile
moveData@data <- cbind(moveData@data, hm$indices)
# derive statistics
hm.region.stats <- hotMoveStats(rid=hm, o.time=as.Date(moveData@data$timestamp))
hm.time.stats <- hotMoveStats(o.time=as.Date(moveData@data$timestamp))
}
# }
Run the code above in your browser using DataLab