| gridcentroid | R Documentation | 
This function identifies latent stay points based on spatial locations of stay events. A spatial grid with adjustable cell sizes is overlaid on stay events and the centroid of all the stay events fallen with one grid is considered a stay point. All the stay events are viewed as visits to the stay point.
gridcentroid(
  df,
  coor = NULL,
  cell.size = NULL,
  cell.units = "meters",
  point.id = NULL,
  group.id = NULL
)
| df | a data frame object. | 
| coor | longitude and latitude of the spatial points in the format of c("lon","lat"). | 
| cell.size | size of the the spatial grid to overlay with spatial points. | 
| cell.units | unit of the cell size length. It has to be meters. | 
| point.id | id of the input spatial points. | 
a data frame with three new columns added showing stay points and locations.
gridcentroid function can be slow if the spatial points are scattered in a large area and grid size is
small. It is recommended to run in small batches.
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
stayevents
data(mobility)
mobility_stay<- stayevent(mobility, coor = c("lon","lat"), time = "datetime", dist.threshold = 100,
                 time.threshold = 30, time.units = "mins", groupvar = "id")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.