Plots the strategy usage for all groups.
plot_strategies(
strategies,
experiment,
factor = NA,
exclude.probe = FALSE,
boundaries = NA,
legend = TRUE,
x.axis = "Day",
titles = TRUE,
screen = FALSE,
margins = c(5, 4, 4, 8),
...
)
This function invisibly returns a named list for each level of the supplied
factor. Each element of this list holds a matrix
of plotting
values for every strategy / trial. These values are cumulative counts of strategy use
for all subjects at each trial. They specify the uppermost points of a layered series
of polygons and could be used to build a customised plot if desired.
The strategy calls as returned from call_strategy
or
similar.
The experiment object as returned from read_experiment
.
The factor by which the data should be grouped.
Should data from probe trials be excluded (see Details).
Where should the boundaries between arena types be drawn (see Details).
Should a legend be drawn. Default is to add a legend to the plot.
The scale of the x axis. Default, "Day", is to add a labelled axis with tick marks at each day. If this parameter is set to "Trial", then tick marks are added for each trial. If set to "none", then no x axis will be drawn.
Should titles be drawn. Default is to add a main title and titles for the
x and y axes. These can be supressed and added afterwards (using
title
). This might be helpful for localising to a different
language for example.
Should multiple plots be drawn to one page. Default is FALSE
. This
can be useful for advanced layout using split.screen
.
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.
Other parameters passed to segments
to control the
plotted lines.
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 data.frame
with two columns 'day' and 'trial'. 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.
# This function relies on data too large to include in the package.
# For a worked example, please see the vignette "Rtrack MWM analysis".
Run the code above in your browser using DataLab