Learn R Programming

longCatEDA (version 0.13)

longCatPlot: Plotting of lc objects

Description

Function to plot longCat objects created by longCat.

Usage

longCatPlot(lc, xlab = "Day", ylab = "Each Line Represents a Participant", 
                cols = NULL, colScheme = "heat", reverse = FALSE, 
                lwd = 0.5, lcex = 1, llwd = 3, legendBuffer = 0.12, 
                groupBuffer = 0.1, groupRotation = 90, gcex = 1, 
                bg = "cornsilk3", seg.len = 1,
                xlas = 0, xcex = 1, ...)

Arguments

lc
an object of class longCat created by longCat. See par.
xlab
a label for the x-axis. Default is "Day". See par.
ylab
a label for the y-axis. Default is "Each Line Represents a Participant". See par.
cols
a numeric or character list of colors. See par. Default is NULL. To use internal color schemes, use colScheme.
colScheme
select a color scheme. See colChoose for available options.
reverse
color schemes are applied from the lowest to highest level of categorical data in lc$data or lc$data.sorted. Set reverse=TRUE to reverse this. Default is FALSE.
lwd
set the width of horizontal lines. Default is .5. lwd should be reduced proportionally to the number of rows in lc$data to avoid overlap in plotting.
lcex
character expansion factor for the legend text. Default is 1. See par.
llwd
set the width of lines in the legend. default is 3. See lwd.
legendBuffer
set proportion of the plot to retain for legends, must be in [0,1]. Note that the legend is very sensitive to the scaling of the graphics device. Users are advised to maximize their device and rerun, or call dev.new() and resize prior to runn
groupBuffer
similar to legendBuffer, but for group labels on the left side of the plot. Default is .1 (i.e., 10% of the horizontal plot area is retained for group labels). Can take on any value in [0,1].
groupRotation
if lc$groupLabels are long (see longCat), rotation of the labels can be used reduce the needed size of groupBuffer.
gcex
character expansion factor for group labels. Default is 1. Seepar.
bg
a background color for plots. Default is 'cornsilk3'. See bg in par.
seg.len
Length of lines in the upper legend. Default is 1. See legend.
xlas
see las in par. Applied to the x-axis when tLabels are provided to longCat.
xcex
see axis.cex in par and axis. Applied to the x-axis when tLabels are provided to longCat
...
Arguments to be passes to plot (see par)

References

Tueller, S. J., Van Dorn, R. A., and Bobashev, G. V. (2013). Visualization of Categorical Longitudinal and Times Series Data. Manuscript Under Review.

See Also

longCat.

Examples

Run this code
# create Figure 3 from Tueller (2011)
par(mfrow=c(1,2), bg='lightblue')
times <- c(1,100,200,300,400,500)
f3lc <- longCat(example3, times); f3lc$sorted <- TRUE; f3lc$data.sorted <- f3lc$data
longCatPlot(f3lc, main='Unsorted', colScheme='heat', lwd=2)
f3lc <- longCat(example3, times)
longCatPlot(f3lc, main='Sorted', colScheme='heat', lwd=2)
par(mfrow=c(1,1), bg='white')

Run the code above in your browser using DataLab