get_plot_data: Get data frame for plotting from an experiment

View source: R/abs_plot.R

get_plot_dataR Documentation

Get data frame for plotting from an experiment

Description

From an experiment, extract a data frame suitable for plotting with ggplot(). Select the relevant columns for plotting, using an x-variable, a y-variable, and an optional grouping variable. If last_tick is TRUE, then only include data for the last tick of each run. Otherwise, include all ticks.

Usage

get_plot_data(experiment, x_var, y_var, group_var, last_tick)

Arguments

experiment

An experiment object, returned by load_bs_file(), load_bs_table(), or load_bs_spreadsheet().

x_var

The name of the independent variable for the x-axis

y_var

The name of the dependent variable for the y-axis.

group_var

The name of the variable to use for grouping.

last_tick

Logical: plot only the last tick (as opposed to plotting all ticks).

Value

A data frame suitable for plotting with ggplot().


jonathan-g/analyzeBehaviorspace documentation built on July 23, 2022, 11:01 a.m.