rp.rmplot: Interactive plotting of repeated measurement data

View source: R/rp-rmplot.r

rp.rmplotR Documentation

Interactive plotting of repeated measurement data

Description

This function creates a panel which controls the display of data which have a repeated measurement structure across time. Groups, means and standard errors can be displayed. Individual profiles can also be inspected.

Usage

rp.rmplot(y, id = NA, timept = NA, fac = NA, type = "all", 
                          xlab = NA, ylab = NA, xlabels = NA, add = FALSE,
                          lwd = 1, col = NA, lty = NA, panel = TRUE, 
                          panel.plot = TRUE, hscale = NA, vscale = hscale, ...)

Arguments

y

a vector, matrix or dataframe of response data. If y is a matrix or dataframe, the rows should correspond to cases and the columns to the repeated measurements.

id

when y is a vector, id should contain the identifiers for the individual profiles.

timept

when y is a vector, timept should contain the time value associated with each repeated measurement. When y is a matrix or dataframe timept may identify the values associated with the repeated measurements (columns); in this case the default value is the sequence from 1 to the number of repeated measurements.

fac

an optional factor to split the data into groups.

type

when the function is not running in interactive panel mode, this character variable determines the type of plot produced. It can be set to "all", "mean", "mean+bar" or "band". The last option is applicable only when there are two groups of data.

xlab

the x-axis label.

ylab

the y-axis label.

xlabels

labels for the repeated measurements, to be printed on the x-axis.

add

a logical variable which determines whether the repeated measurements graph is added to an existing plot. This is only appropriate when panel = FALSE.

lwd

the width of the lines drawn for each repeated measurements profile.

col

a vector of colours associated with each of the factor levels in fac.

lty

a vector of linetypes associated with each of the factor levels in fac.

panel

a logical variable controlling whether an interactive panel is created.

panel.plot

a logical parameter which determines whether the plot is placed inside the panel (TRUE) or the standard graphics window (FALSE). If the plot is to be placed inside the panel then the tkrplot library is required.

hscale, vscale

scaling parameters for the size of the plot when panel.plot is set to TRUE. The default values are 1 on Unix platforms and 1.4 on Windows platforms.

...

further arguments which will be passed to the plot call in the construction of the graph.

Details

This function is designed principally for repeated measurements over time, with common time points for each profile. A set of radiobuttons allows all the individual profiles to be plotted, or summaries in the form of means and two standard errors. A checkbox allows the data to be split into groups identified by the variable fac. When there are only two groups, a band can be displayed to indicate time points at which the distance between the observed means is more than two standard errors of the differences between the means.

Value

Nothing is returned.

References

rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.

Examples

## Not run: 
   LH    <- luthor[,2:16]
   gp    <- factor(luthor[,1])
   times <- c(1:5,(5+(1:10)/2))
   rp.rmplot(log(LH), fac = gp, timept = times)

## End(Not run)

rpanel documentation built on Feb. 16, 2023, 10:37 p.m.

Related to rp.rmplot in rpanel...