mt_add_trajectory {mousetrap}R Documentation

Add new trajectory to trajectory array.

Description

Add a single new trajectory to trajectory array.

Usage

mt_add_trajectory(
  data,
  use = "trajectories",
  save_as = use,
  xpos = NULL,
  ypos = NULL,
  xypos = NULL,
  id = "new"
)

Arguments

data

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).

use

a character string specifying which trajectory data should be used.

save_as

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

xpos

a vector of x positions. Ignored, if xypos is provided.

ypos

a vector of y positions. Ignored, if xypos is provided.

xypos

a matrix, the first column corresponding to the x positions, the second to the y positions.

id

a character string specifying the identifier of the to be added trajectory.

Value

A mousetrap data object (see mt_example) where the new trajectory has been added. If the trajectory array was provided directly as data, only the trajectory array will be returned.

Author(s)

Pascal J. Kieslich

Felix Henninger

Examples

# Add additional prototype to mt_prototypes
mt_prototypes_ext <- mt_add_trajectory(mt_prototypes,
   xpos = c(0,1,-1,1,-1), ypos = c(0,1.5,1.5,1.5,1.5), id = "dCoM3"
)


[Package mousetrap version 3.2.3 Index]