Last chance! 50% off unlimited learning
Sale ends in
Provides statistics for the output of hotMove.
hotMoveStats(rid = rid, time = NULL, tUnit = NULL, aid = NULL,
method = "deg")
List object as provided by hotMove().
Object of class Date, POSIXlt or POSIXct.
Time unit for stats. Default is days. See difftime
for additional keywords.
Optional. Unique identifiers.
Method used to estimate polygon area.
A data frame.
This functions analysis the attributes of sample regions define by hotMove(). For each sample region, the function returns the amount of samples (tns. If a vector of unique identifiers is provided (aid) the number of unique identifiers observed within each region is also reported. If temporal information is provided (time) the function identifies unique temporal segment corresponding to periods of consecutive days with observations. For each segment, the function reports on the amount of segment s(nts) as well as the minimum (mnt), maximum (mxt) and mean (avt), ) of the time segments and the total amount of time that they amount to (tts). If rid contains polygons for each region, the function also reports on the area of convex polygons. In this case, the user can use the method keyword to specify how the polygons should be handled. If the polygons are in lat-lon, method deg can be used to re-project each polygon to its corresponding UTZ zone before retrieving the area. This is the default, if the polygons are in a cartesian coordinate system use m.
# NOT RUN {
{
require(rgdal)
require(raster)
require(sp)
# reference data
file <- system.file('extdata', 'latLon_example.shp', package="rsMove")
moveData <- shapefile(file)
# 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.stats <- hotMoveStats(rid=hm, time=as.Date(moveData@data$timestamp))
}
# }
Run the code above in your browser using DataLab