ppl_plot_avg: Plots average Pupil.

Description Usage Arguments Examples

View source: R/plotting.R

Description

ppl_plot_avg calculates the grand or conditional averages with standard error. It then plots the results. N.B.: This function will work for data with a maximum of 2 conditions.

Usage

1
2
3
4
5
ppl_plot_avg(data, xlim = NA, Column = NULL, Averaging = "Event",
  Condition1 = NULL, Condition2 = NULL, Cond1Labels = NA,
  Cond2Labels = NA, ErrorBar = TRUE, PupilPreTheme = TRUE,
  ConfLev = 95, CItype = "simultaneous", ErrorBand = FALSE,
  ErrorType = "SE")

Arguments

data

A data table object output after having executed create_time_series.

xlim

A vector of two integers specifying the limits of the x-axis.

Column

A character string specifying the desired column.

Averaging

A character string indicating how the averaging should be done. "Event" (default) will produce the overall mean in the data, while "Subject" or "Item" (or, in principle, any other column name) will calculate the grand mean by that factor.

Condition1

A string containing the column name corresponding to the first condition, if available.

Condition2

A string containing the column name corresponding to the second condition, if available.

Cond1Labels

A named character vector specifying the desired custom labels of the levels of the first condition.

Cond2Labels

A named character vector specifying the desired custom labels of the levels of the second condition.

ErrorBar

A logical indicating whether error bars should be included in the plot.

PupilPreTheme

A logical indicating whether the theme included with the function should be applied, or ggplot2's base theme (to which any other custom theme could be added)..

ConfLev

A number indicating the confidence level of the CI.

CItype

A string indicating "simultaneous" or "pointwise". Simultaneous performs a Bonferroni correction for the interval.

ErrorBand

A logical indicating whether error bands should be included in the plot.

ErrorType

A string indicating "SE" (Standard Error) or "CI" (Confidence Interval).

Examples

1
2
3
4
5
6
7
8
9
# Load example data
data("Pupilex7")

ppl_plot_avg(data = Pupilex7, xlim = c(0, 1900), Column = "Pupil",
             Condition1 = NULL, Condition2 = NULL, Cond1Labels = NA,
             Cond2Labels = NA, ErrorBar = TRUE, PupilPreTheme = TRUE)

# Please see the vignettes for detailed example usage.
# vignette("PupilPre_Plotting", package="PupilPre")

PupilPre documentation built on March 14, 2020, 1:08 a.m.