Description Usage Arguments Value Examples
Create a heatmap based on movement data
1 2 |
l |
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
|
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 |
zero.to.na |
logical indicating whether to recode unvisited cells to NA (default is TRUE) |
print |
logical indicating if output should be printed via |
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 | library(dplyr)
library(ggplot2)
data(movdat)
movhm(movdat, 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_Blues, na.value = rgb(0, 0, 0, 0)) +
coord_fixed() +
theme_movhm()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.