Learn R Programming

fixedpointproperty (version 1.0)

plot.fpp: Function to plot the distributions and differences of multiple binary mixture distributions.

Description

This function plots kernel-based densities as well as density differences for three or more data sets (fpp objects).

Usage

# S3 method for fpp
plot(x, ylab = c("Density", "Density difference"), xlim = NULL, ...)

Value

No return value, called for side effects

Arguments

x

an fpp object

ylab

y-axis labels of the two plots

xlim

the x limits (x1, x2) of the two plots

...

additional arguments to pass to both plot.density and matplot

Author

Leendert van Maanen (l.vanmaanen@uu.nl)

Details

Generates two plots, one showing the estimated densities (based on plot.density) and one showing the density differences (based on matplot)

References

Van Maanen, L., De Jong, R., Van Rijn, H (2014). How to assess the existence of competing strategies in cognitive tasks: A primer on the fixed-point property. PLOS One, 9, e106113

Van Maanen, L. Couto, J. & Lebetron, M. (2016). Three boundary conditions for computing the fixed-point property in binary mixture data. PLOS One, 11, e0167377.

See Also

fpGet,fpDensDiff,plot.density,matplot

Examples

Run this code
## generate data
p <- c(.1,.5,.9)
rt <- sapply(1:3, function(i) {rnormMix(1000, c(1,2), c(1,1), p[i])})
dat <- data.frame(rt=c(rt), cond=rep(1:3, each=1000))

## compute fpp object
fpobject <- fpGet(dat, 1000, bw=.75)

## plot it
op <- par(mfrow=c(1,2))
plot(fpobject)
par(op)

Run the code above in your browser using DataLab