Description Usage Arguments Value Note References See Also Examples
This function calculates stay events based on spatial locations and time stamps of mobility data. A distance threshold and a time threshold are given to determine if points are in the same stay event set. The centroid of points in one stay event set is calculated as the spatial location of the stay event.
1 2 3 |
df |
a data frame object. |
coor |
longitude and latitude of the spatial points in the format of c("lon","lat"). |
time |
a POSIXct time object, used to calculate time period. |
dist.threshold |
a distance threshold used to determine if points are in the same group. The format is numeric. Unit is meters. |
time.threshold |
a numeric object. Value should have the same unit specified in the |
time.units |
a character string indicating which units time difference is caluclated in. |
groupvar |
grouping object to stratify time objects. Recommend to be ID for each individual.
If |
a data frame with three new columns added showing stayevents and locations.
stayevent
function doesn't sort the data frame. It is recommended to sort data frame based on
time and then run the function.
Toole, J.L., et al. The path most traveled: Travel demand estimation using big data resources. Transport. Res. Part C (2015), http://dx.doi.org/10.1016/j.trc.2015.04.022
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.