# 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$indices <- hm$indices
}
# }
Run the code above in your browser using DataLab