plot.Pupil_difference_data: Pre-prepared plots of PupillometryR data

Description Usage Arguments Value Examples

View source: R/plot_pupil_data.R

Description

The plot functions are designed to run with just data and pupil selections, with some additional options for fun with plotting. To see these plots, you must first use create_difference_data.

Usage

1
2
## S3 method for class 'Pupil_difference_data'
plot(x, pupil, geom = c("point", "line"), colour = "black", ...)

Arguments

x

A Pupil_difference_data dataframe

pupil

Column name of pupil data to be plotted

geom

string indicating whether made of connected points or a line

colour

string indicating colour of geom, passed to ggplot2

...

Ignored

Value

A ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Sdata <- make_pupillometryr_data(data = pupil_data,
                               subject = ID,
                               trial = Trial,
                               time = Time,
                               condition = Type)
regressed_data <- regress_data(data = Sdata, pupil1 = RPupil, pupil2 = LPupil)
mean_data <- calculate_mean_pupil_size(data = regressed_data,
pupil1 = RPupil, pupil2 = LPupil)
base_data <- baseline_data(data = mean_data, pupil = mean_pupil, start = 0, stop = 100)
differences <- create_difference_data(data = base_data,
pupil = mean_pupil)
p <- plot(differences, pupil = mean_pupil, geom = 'line')
p

samhforbes/PupillometryR documentation built on Sept. 14, 2021, 11:50 p.m.