Re-represent each trajectory spatially using a constant number of points so that adjacent points on the trajectory become equidistant to each other.

  use = "trajectories",
  dimensions = c("xpos", "ypos"),
  save_as = "sp_trajectories",
  n_points = 20



a mousetrap data object created using one of the mt_import functions (see mt_example for details). Alternatively, a trajectory array can be provided directly (in this case use will be ignored).


a character string specifying which trajectory data should be used.


a character string specifying which trajectory variables should be used. Can be of length 2 or 3 for two-dimensional or three-dimensional data.


a character string specifying where the resulting trajectory data should be stored.


an integer or vector of integers specifying the number of points used to represent the spatially rescaled trajectories. If a single integer is provided, the number of points will be constant across trajectories. Alternatively, a vector of integers can provided that specify the number of points for each trajectory individually.


A mousetrap data object (see mt_example) with an additional array (by default called sp_trajectories) containing the spatialized trajectories. If a trajectory array was provided directly as data, only the spatialized trajectories will be returned.


mt_spatialize is used to emphasize the trajectories' shape. Usually, the vast majority of points of a raw or a time-normalized trajectory lie close to the start and end point. mt_spatialize re-distributes these points so that the spatial distribution is uniform across the entire trajectory. mt_spatialize is mainly used to improve the results of clustering (in particular mt_cluster) and visualization.


KH2017 <- mt_spatialize(data=KH2017, dimensions = c('xpos','ypos'), n_points = 20)