plot_ybr: Plot time series data derived from Yoshi Behaviour Rig

Description Usage Arguments Details See Also Examples

View source: R/yoshi_behav_functions.R

Description

Plot time series data derived from Yoshi Behaviour Rig

Usage

1
2
3
4
5
6
7
8
9
plot_ybr(
  x,
  filter = FALSE,
  sides = 1,
  randts = FALSE,
  lights = c(on1 = 30, off1 = 60, on2 = 90, off2 = 120),
  lightcol = rgb(1, 0, 0, alpha = 0.3),
  ...
)

Arguments

x

A (multi-)time series object containing one or more behavioural variables.

filter

Either the width in seconds of a simple smoothing filter or a filter defined according to filter. The signalling value of filter=F suppresses any filtering.

sides

Whether the filter is causal i.e. for past values only (the default) or centered around lag=0. See filter for details.

randts

Whether to include a randomised version of the time series as a second plot. Default to true if data are being filtered

lights

A length 2 or more vector defining the lights on/off times for the experiment (in seconds).

lightcol

The colour to use to plot the lights on epochs

...

Additional arguments to plot.ts

Details

This plot includes an optional smoothed randomised time series which is made by randomly permuting the timepoints in the main time series and then applying the same smoothing filter. If you want this time series to be reliably the same pseudorandom series for publication purposes you may need to see the random seed (see set.seed)

See Also

filter, plot.ts

Other ybr-plot: plot_smoothed_displacement()

Examples

1
2
3
4
5
6
7
8
9
tiffdf=find_ybr_tiffs(system.file("ybr_tiffs", package='flywatch'))
summdata=read_ybr_summary(tiffdf$tiff[1])
plot_ybr(summdata[,'PIpixel'], filter=FALSE)
plot_ybr(summdata[,'PIpixel'], filter=1)
plot_ybr(summdata[,'PIpixel'], filter=1, randts=TRUE)
plot_ybr(summdata[,c('PIpixel','PIn')], filter=1)
plot_ybr(summdata[,c('PIpixel','PIn')], filter=1)
plot_ybr(summdata[,c('PIpixel', 'PIn')], filter=1, plot.type = "single",
  col=c('red','blue'))

jefferislab/flywatch documentation built on Aug. 6, 2021, 12:14 p.m.