lines.jointdata: Add lines to an existing 'jointdata' plot

Description Usage Arguments Value Author(s) See Also Examples

View source: R/lines.jointdata.R

Description

Add lines to an existing plot of an object of class jointdata, for a longitudinal variable. It is possible to plot all the subjects in the data set, or just a selected subset. See subset.jointdata.

Usage

1
2
## S3 method for class 'jointdata'
lines(x, Y.col, ...)

Arguments

x

object of class jointdata.

Y.col

column number, or column name, of longitudinal variable to be plotted. Defaults to Y.col = NA, plotting all longitudinal variables.

...

other graphical arguments; see plot.

Value

A graphical device with a plot for longitudinal data.

Author(s)

Ines Sousa (isousa@math.uminho.pt)

See Also

Other functions are useful to be used with this such as plot and points.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(heart.valve)
heart.surv <- UniqueVariables(heart.valve, 
                              var.col = c("fuyrs", "status"), 
                              id.col = "num")
heart.long <- heart.valve[, c(1, 4, 5, 7, 8, 9, 10, 11)]
heart.jd <- jointdata(longitudinal = heart.long, 
                      survival = heart.surv,
                      id.col = "num",
                      time.col = "time")
                      
# Randomly select a pair of subjects to plot profiles of
take <- sample(1:max(heart.jd$survival$num), 2)
heart.jd.1 <- subset(heart.jd, take[1])
heart.jd.2 <- subset(heart.jd, take[2])

plot(heart.jd.1, Y.col = 4)
lines(heart.jd.2, Y.col = 4, lty = 2)

joineR documentation built on May 23, 2017, 9:07 a.m.

Search within the joineR package
Search all R packages, documentation and source code