Plots the strategy usage for all groups.

plot_strategies(
  strategies,
  experiment,
  factor = NA,
  exclude.probe = FALSE,
  boundaries = NA,
  legend = TRUE,
  screen = FALSE,
  margins = c(5, 4, 4, 8),
  lwd = 2
)

Arguments

strategies

The strategy calls as returned from call_strategy.

experiment

The experiment object as returned from read_experiment.

factor

The factor by which the data should be grouped. The default, NA, means that all data will be shown in one plot. Specifying a grouping factor will cause a separate plot to be generated for each group.

exclude.probe

Should data from probe trials be excluded (see Details).

boundaries

Where should the boundaries between arena types be drawn (see Details).

legend

Should a legend be drawn. Default is to add a legend to the plot.

screen

Should multiple plots be drawn to one page. Default is FALSE. This can be useful for advanced layout using split.screen.

margins

The margins of the plot (see the option mar in par). The defaults should usually be fine, but they can be overridden if, for example, factor names are very long.

lwd

The thickness of the plotted lines. Default is 2.

Value

A list of strategy call information.

Details

The strategies returned by read_experiment can be shown in a summary plot. In these plots, the fraction of subjects utilising a particular strategy is shown for each day/trial. If a factor is provided, then one plot will be made for each level of the factor. To view data for mutliple factors, they will need to be collapsed into one composite factor for plotting using this function. If probe trials were used, these can be ignored (not plotted) as the strategy use in the absence of the goal will be somewhat different. For this to work, a column named "Probe" must be present in the experiment description spreadsheet and must contain the value "TRUE" for each probe trial.

Boundaries are drawn (as broken vertical lines) between different arena types (for example between acquisition and goal reversal phases of a Morris water maze experiment). By default, these are added between each unique arena definition. If this is not appropriate, then this can be overridden by providing the boundaries parameter with a matrix or data.frame with two columns for the day and trial number respectively. Multiple boundaries can be defined by entering the day and trial index into rows of this table. Use boundaries = NULL to suppress boundary lines altogether.

Examples

# This function relies on data too large to include in the package.
# For a worked example, please see the vignette "Rtrack MWM analysis"
# in the online package documentation at
# https://rupertoverall.net/Rtrack/.