Description Usage Arguments Value Author(s) References Examples
Function normalizes trajectories with respect to time or space.
1 |
data |
A data frame containing the x, y, t variables and indicator variables which uniquely identify single trajectories |
i.xyt |
Vector containing the column names of the x, y, t variables in that order. |
i.id |
Vector containing the column names of the indicator variables that jointly uniquely identify single trajectories (e.g. |
type |
type='time'
normalizes trajectory with respect to time (all trajectories have the same number of steps of time steps). This is the standard data preprocessing procedure for mousetracking. type='spatial'
normalizes trajectories with respect to space, i.e. we place a specified number of equally spaced (with respect to space) points on the trajectory. This is useful for comparing trajectories using a distance measure.
steps |
The number of steps that should intrapolated (with respect to time or space, depending on |
start2zero |
If TRUE, the startpoint of each trajectory is set to (0,0) |
stretch |
Each trajectory is 'streched' into a specified norm-display. The norm display is specified as a list with the coordinates of the start point and the two possible end points of the trajectories. See the example below. This is useful for comparing data from various studies with different layout. |
takeAllvar |
Default |
The function returns a list:
call |
Returns all function input except the data. |
data |
Returns a data frame with normalized trajectories. |
Jonas Haslbeck <jonashaslbeck@gmail.com>
Spivey, M. J., Grosjean, M., & Knoblich, G. (2005). Continuous attraction toward phonological competitors. Proceedings of the National Academy of Sciences of the United States of America, 102(29), 10393-10398.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
# THIS EXAMPLE DOES NOT WORK ANYMORE !!!
# we use a part of the following example dataset
head(data_sp2015)
# we use prepr() to time normalize all trajectories to 101 time-steps and strech them to a norm display
layout_stretch <- list("start"=c(0,0), "left"=c(-1,1.5), "right"=c(1,1.5))
output <- prepr(data = data_sp2015[1:1000,],
i.xyt = c('x', 'y', 't'),
i.id = c('id.ptp', 'id.trial'),
type = "time",
steps = 101,
start2zero = TRUE,
stretch = layout_stretch)
head(output$data)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.