mt_diffmap
creates a difference-heatmap of the trajectory data using
gaussian smoothing. Note that this function has beta status.
mt_diffmap(
x,
y = NULL,
condition = NULL,
use = "trajectories",
dimensions = c("xpos", "ypos"),
use2 = "data",
filename = NULL,
bounds = NULL,
xres = 500,
upscale = 4,
smooth_radius = 10,
colors = c("#00863F", "#000000", "#FF1900"),
n_shades = 1000,
plot = TRUE,
...,
verbose = TRUE
)
an object of class mousetrap
), a trajectory object of class
array
, or an object of class mt_heatmap_raw
(as created by
mt_heatmap_raw).
an object of class mousetrap
), a trajectory object of class
array
, or an object of class mt_heatmap_raw
(as created by
mt_heatmap_raw). The class of y
must match the class of
x
, unless y
is NULL
.
either a character value specifying which variable codes the
two conditions (in x[[use2]]
) that should be compared - or a vector
matching the number of trajectories in x[[use]]
that has exactly two
levels. mt_diffmap
will create a difference-heatmap comparing all
trajectories between the two conditions. If condition
is specified,
y
will be ignored (unless x
and y
are of class
heatmap_raw
).
a character string specifying which trajectory data should be used.
a character vector specifying the trajectory variables used to create the heatmap. The first two entries are used as x and y-coordinates, the third, if provided, will be added as color information.
an optional character string specifying where the data that
contain the condition variable can be found. Defaults to "data" as
x[["data"]]
usually contains all non mouse-tracking trial data.
numeric vector specifying the corners (xmin, ymin, xmax, ymax)
of the plot region. By default (bounds = NULL
), bounds are
determined based on the data input.
an integer specifying the number of pixels along the x-dimension.
An xres
of 1000 implies an 1000*N px, where N is determined so that
the trajectories aspect ratio is preserved (provided the bounds
are
unchanged).
a numeric value by which the output resolution of the image is increased or decreased. Only applies if device is one of tiff, png, or pdf.
a numeric value specifying the standard deviation of the gaussian smoothing. If zero, smoothing is omitted.
a character vector specifying the colors used to color
cases of image1 > image2, image1 ~ image2, image1 < image2
,
respectively. Note that the colors are used in that specific order.
Defaults to c("#00863F", "#FFFFFF", "#FF1900") which specifies
a green-black-red color gradient.
integer specifying the number of shades for the color
gradient between the first and second, and the second and third color in
colors
.
logical specifying whether resulting image should be plotted
(plot = TRUE
, the default). If (plot = FALSE
), an object of
class mt_object_raw
is returned.
arguments passed to mt_heatmap_raw.
logical indicating whether function should report its progress.
mt_diffmap
takes two objects that either contain trajectory heatmaps
or from which trajectory heatmaps can be computed. Difference-heatmaps are
constructed analogously to mt_heatmap_raw.
Wulff, D. U., Haslbeck, J. M. B., Kieslich, P. J., Henninger, F., & Schulte-Mecklenbeck, M. (2019). Mouse-tracking: Detecting types in movement trajectories. In M. Schulte-Mecklenbeck, A. K<U+00FC>hberger, & J. G. Johnson (Eds.), A Handbook of Process Tracing Methods (pp. 131-145). New York, NY: Routledge.
Kieslich, P. J., Henninger, F., Wulff, D. U., Haslbeck, J. M. B., & Schulte-Mecklenbeck, M. (2019). Mouse-tracking: A practical guide to implementation and analysis. In M. Schulte-Mecklenbeck, A. K<U+00FC>hberger, & J. G. Johnson (Eds.), A Handbook of Process Tracing Methods (pp. 111-130). New York, NY: Routledge.
mt_heatmap and mt_heatmap_ggplot for plotting trajectory heatmaps.
# NOT RUN {
mt_diffmap(KH2017, condition="Condition",
xres=400, smooth_radius=6, n_shades=5)
# }
Run the code above in your browser using DataLab