heatmapGIF: Morris water maze heatmap GIF

Description Usage Arguments

View source: R/heatmapGIF.R

Description

The heatmapGIF function creates a raster or contour heatmap GIF of the animal for a specific trial.

Usage

 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
heatmapGIF(
  data,
  id,
  day,
  trial,
  centerx,
  centery,
  radius = 75,
  platformx,
  platformy,
  platformradius = 7.5,
  ndata_circle = 100,
  remove_data_outside_maze = TRUE,
  platform_colour = NA,
  platform_alpha = 1,
  platform_linetype = "solid",
  platform_line_colour = "black",
  platform_line_size = 0.5,
  heatmap_low = "yellow",
  heatmap_high = "red",
  type = "raster",
  interpolate = TRUE,
  contour_filled = TRUE,
  contour_colour_scaled = FALSE,
  contour_colour_filled = NA,
  contour_colour = "blue",
  loop = FALSE,
  width = 480,
  height = 480,
  duration = 10,
  frames = 100,
  resolution = 80,
  theme_settings = NULL,
  title = NA,
  show_time = FALSE,
  plot_original_platform = FALSE,
  original_platformx = NULL,
  original_platformy = NULL,
  original_platform_colour = "grey",
  original_platform_alpha = 0.4,
  original_platform_linetype = "dotted",
  original_platform_line_size = 0.5,
  original_platform_line_colour = "black"
)

Arguments

data

Data set containing at least following columns: "Time", "x", "y", "Animal", "Day", "Trial". "x" and "y" represent the coordinates (position) of the animal at a certain timepoint ("Time") during the trial.

id

ID of the animal

day

day number

trial

trial number

centerx

x coordinate of the center of the morris water maze (cm)

centery

y coordinate of the center of the morris water maze (cl)

radius

radius of the morris water maze (cm), default = 75

platformx

x coordinate of the center of the platform (cm)

platformy

y coordinate of the center of the platform (cm)

platformradius

radius of the platform (cm), default = 7.5

ndata_circle

Number of data points in the circle data set. Higher means smoother (more perfect) circle. Default = 100

remove_data_outside_maze

Remove datapoints that lie outside the water maze. Default = TRUE

platform_colour

Colour of the platform. Name or hexadecimal code (e.g.: #FF1020). Default = NA

platform_alpha

Alpha level for platform. Default = 1

platform_linetype

Linetype for platform. Derived from ggplot2. Default = "solid"

platform_line_colour

Colour of platform circle. Default = "black"

platform_line_size

Size of platform line. Default = 0.5

heatmap_low

Low range colour heatmap. Default = "yellow"

heatmap_high

High range colour heatmap. Default = "red"

type

Type of heatmap. Options are "raster" or "contour". Default = "raster"

interpolate

Interpolate raster heatmaps? Ignored for contour heatmaps. Default = TRUE

contour_filled

Fill contour heatmaps? Ignored for raster heatmaps. Default = TRUE

contour_colour_scaled

Colour scale for contour heatmaps. When false, colour of contour lines is set by contour_colour. When TRUE, colour scale is set by heatmap_low and heatmap_high. Default = FALSE

contour_colour_filled

Colour of contour lines in filled contour heatmap. Default = NA

contour_colour

Colour of contour lines in empty contour heatmap. Default = "blue"

loop

Loop the animation, default = FALSE

width

Width of the animation (px), default = 480

height

Height of the animation (px), default = 480

duration

Duration of the animation (s), default = 10

frames

Number of frames in the animation, default = 100

resolution

Resolution of GIF, passed to gifski. Default = 80

theme_settings

Optional parameter that passes list of arguments to ggplot2's theme() function.

title

Add title to GIF. Default = NA

show_time

Shows trial time(s) as subtitle (ggplot). Default = FALSE

plot_original_platform

Plot the original platform (for reversal trials). Default = FALSE

original_platformx

x coordinate of the center of the original platform (cm). Ignored if plot_original_platform = FALSE

original_platformy

y coordinate of the center of the original platform (cm). Ignored if plot_original_platform = FALSE

original_platform_colour

Colour of the original platform. Name or hexadecimal code (e.g.: #FF1020). Ignored if plot_original_platform = FALSE. Default = "grey"

original_platform_alpha

Alpha level for original platform. Ignored if plot_original_platform = FALSE. Default = 0.4

original_platform_linetype

Linetype of original platform circle. Ignored if plot_original_platform = FALSE. Default = "dotted"

original_platform_line_size

Size of original platform circle. Ignored if plot_original_platform = FALSE. Default = 0.5

original_platform_line_colour

Colour of original platform circle line. Ignored if plot_original_platform = FALSE. Default = "black"


Thonnard/VisualMWM documentation built on Aug. 22, 2020, 4:41 p.m.