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 = "ln_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 ln_trajectories) containing the length normalized trajectories. If a trajectory array was provided directly as data, only the length normalized trajectories will be returned.


mt_length_normalize 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_length_normalize re-distributes these points so that the spatial distribution is uniform across the entire trajectory. mt_length_normalize is mainly used to improve the results of clustering (in particular mt_cluster) and visualization.


Dirk U. Wulff

Jonas M. B. Haslbeck

Pascal J. Kieslich


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