Description Usage Arguments Value Examples
Create a difference heatmap based on movement data
1 2 3 |
lx |
a list of data frames containing columns for x- and y-values |
ly |
a list of data frames containing columns for x- and y-values |
x |
name of the column containing x-values in the data frames in
|
y |
name of the column containing y-values in the data frames in
|
difference |
a character string specifying whether to compute
|
blocksize |
scaling factor |
margins |
numeric vector of length 4 containing the margins (xmin, ymin, xmax, ymax) |
origin |
(optional) numeric vector of length 2 (x and y) of the position to be removed from the heatmap (e.g. starting position) |
consider.time |
logical indicating whether to count one subject multiple times in one cell, depending on the time the subject was inside the cell. |
time.transformation |
if |
print |
logical indicating if output should be printed via ggplot |
A data frame with x, y and f (freqency) columns ready for plotting with ggplot2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(dplyr)
library(ggplot2)
data(movdat)
movhm.diff(movdat[1:21], movdat[22:42], x = "cart_x", y = "cart_y",
blocksize = 50, margins = c(-750, -2000, 100, 1550),
origin = c(-120, -1000)) %>%
ggplot(aes(x, y, fill = f)) +
geom_raster() +
scale_fill_gradientn(colours = scale_RdBu, na.value = rgb(0, 0, 0, 0),
limits = c(-.4, .4)) +
coord_fixed() +
theme_movhm()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.