ch.plot.learning: A function to plot the learning effect in data

ch.plot.learningR Documentation

A function to plot the learning effect in data

Description

This function plots the fit of a non-linear, decellerating function to the specifed data.

Usage

ch.plot.learning(
  x,
  y,
  fit = NULL,
  plotTitle = NA,
  filename = NULL,
  cex1 = 1,
  yLabel = NA,
  xLabel = "Trial Number",
  ylimMin = 0,
  ylimMax = 0,
  ...
)

Arguments

x

a vector containing the x variable.

y

a vector containing the y variable.

fit

a vector containing the variable with the best fit to the datapoints. If fit==NULL, then no function will be fit. If length(fit) == 2, then abline will be fit. if length(fit) == length(x), fit will be the best predicted datapoints for each x.

plotTitle

a string with the title of the plot.

filename

a string with the filename of the pdf of the file to be saved. DEFAULT = NULL; no file saved.

cex1

a numeric value for cex: the relative size of the text in the graph. cex1 > 1 is bigger; cex1 < 1 is smaller. DEFAULT=1.

yLabel

a string with the title of y-axis. DEFAULT=NA.

xLabel

a string with the title of x-axis. DEFAULT="Trial Number".

ylimMin

a number denoting the minimum of the y-axis. DEFAULT=0.

ylimMax

a number denoting the maximum of the y-axis. DEFAULT=0. If ylimMin == ylimMax, the function determines a pretty y-axis for you.

Value

nothing.

Examples

ch.plot.learning (trial, RT, fit, "myplot.pdf")

ccpluncw/ccpl_R_chutils documentation built on Feb. 28, 2024, 1:17 a.m.