## starting httpd help server ... done
##
## longCt> # create the longcat object similar to Figure 2 in Tueller (2016)
## longCt> times <- c(1,100,200,300,400,500,600)
##
## longCt> f2lc <- longCat(example2cat, times)
##
## longCt> # object summary
## longCt> summary(f2lc)
## $dim
## [1] 20 6
##
## $factors
## [1] 1 2 3 4 5
##
## $IndTime
## [1] FALSE
##
## $nfactors
## [1] 5
##
## $sorted
## [1] FALSE
##
## $ascending
## NULL
##
## $group
## < table of extent 0 >
##
##
## longCt> # compare growth curves to longCat
## longCt> par(mfrow=c(1,2), bg='cornsilk3')
##
## longCt> longContPlot(example2cat, times, ylim=c(1,5),
## longCt+ main='Growth Curves', ylab='', xlab='Days')
##
## longCt> longCatPlot(f2lc, lwd=4, main='Horizontal Line Plot', colScheme='heat', legendBuffer=.2)

##
## longCt> par(mfrow=c(1,1), bg='transparent')
##
## longCt> # illustrate individually varying times of observation
## longCt> set.seed(642531)
##
## longCt> y <- matrix(sample(1:5, 500, replace=TRUE), 100, 5)
##
## longCt> set.seed(963854)
##
## longCt> times <- matrix(runif(600, 1, 3), 100, 6)
##
## longCt> # times must be cumulative
## longCt> times <- t(apply(times, 1, cumsum))
##
## longCt> lc <- longCat(y, times=times)
##
## longCt> par(mfrow=c(1,1), bg='cornsilk3', mar=c(5.1, 4.1, 4.1, 10.1), xpd=TRUE)
##
## longCt> cols <- longCatPlot(lc, legendBuffer=0, groupBuffer=0,
## longCt+ main='Individually Varying Times of Observation')

##
## longCt> legend(15.5, 100, legend=lc$Labels, lty=1, col=cols, lwd=2)
##
## longCt> par(bg='transparent', mar = c(5, 4, 4, 2) + 0.1, xpd=FALSE)
##
## longCt> # illustrate the adding event indicators
## longCt> set.seed(45962)
##
## longCt> events <- matrix(sample(1:3, 200, replace=TRUE), 100, 2)
##
## longCt> set.seed(23498)
##
## longCt> event.times <- matrix(sample(c(times), 200, replace=FALSE), 100, 2)
##
## longCt> labels <- c('Street', 'Drug Tx', 'Jail', 'Prison', 'Unknown')
##
## longCt> eventLabels=c('Arrest', 'Drug Test', 'Hearing')
##
## longCt> lc <- longCat(y, times=times, Labels=labels,
## longCt+ events=events, event.times=event.times,
## longCt+ eventLabels=eventLabels)
##
## longCt> par(mfrow=c(1,1), bg='cornsilk3', mar=c(5.1, 4.1, 4.1, 12.1), xpd=TRUE)
##
## longCt> cols <- longCatPlot(lc, legendBuffer=0, groupBuffer=0,
## longCt+ main='Superimpose Events Over States')

##
## longCt> legend(15.5, 100, legend=lc$Labels, lty=1, col=cols, lwd=2)
##
## longCt> legend(15.5, 40, legend=lc$eventLabels, pch=1:length(lc$eventLabels))
##
## longCt> par(bg='transparent', mar = c(5, 4, 4, 2) + 0.1, xpd=FALSE)
##
## longCt> ## Not run:
## longCt> ##D # illustrate handling non time-ordered input (e.g., factor analysis data)
## longCt> ##D y <- matrix(sample(c('1', '2', '3', '4', '5'), 500, replace=TRUE), 100, 5)
## longCt> ##D lc <- longCat(y)
## longCt> ##D par(mfrow=c(1,1), bg='cornsilk3', mar=c(5.1, 4.1, 4.1, 8.1), xpd=TRUE)
## longCt> ##D cols <- longCatPlot(lc, legendBuffer=0)
## longCt> ##D legend(6, 100, legend=lc$factors, lty=1, col=cols, lwd=2)
## longCt> ##D par(bg='transparent', mar = c(5, 4, 4, 2) + 0.1, xpd=FALSE)
## longCt> ##D
## longCt> ##D # illustrate plotting with more than 9 categories
## longCt> ##D # (a warning is issued)
## longCt> ##D y <- matrix(sample(1:18, 500, replace=TRUE), 100, 5)
## longCt> ##D lc <- longCat(y)
## longCt> ##D par(mfrow=c(1,1), bg='cornsilk3', mar=c(5.1, 4.1, 4.1, 8.1), xpd=TRUE)
## longCt> ##D cols <- longCatPlot(lc, legendBuffer=0)
## longCt> ##D legend(6, 100, legend=lc$factors, lty=1, col=cols, lwd=2)
## longCt> ##D par(bg='transparent', mar = c(5, 4, 4, 2) + 0.1, xpd=FALSE)
## longCt> ## End(Not run)
## longCt>
## longCt>
## longCt>
## longCt>