Learn R Programming

cg (version 1.0-3)

profileGraph.cgPairedDifferenceData: Graph Profiles of Experimental Unit Pairs in a cgPairedDifferenceData object

Description

Create a profile graph of the data in a cgPairedDifferenceData object.

Usage

"profileGraph"(data, ...)

Arguments

data
...
Additional arguments, both optional. Two are currently valid:
logscale
A logical value, indicating whether or not the point graph should be plotted on the logarithmic scale. If logscale is not specified, its value is taken from the cgPairedDifferenceData object, which prepareCGPairedDifferenceData sets from its logscale argument.

ticklabels
A list of two components:
mod
Can be either of these two values,
"replace"
Before graphing the data, remove any automatically generated tickmarks for the y-axis, and create the tickmarks specified in the marks component below.

"add"
Before graphing the data, add tickmarks specified in the marks component below, to the automatically generated ones.

marks
A vector of tickmarks to be placed on the y-axis. Any numeric representations will be coerced to character.

Value

profileGraph.cgPairedDifferenceData returns an invisible NULL. The main purpose is the side effect of graphing to the current device.

Details

The profile graph for paired difference data is the simplest of profiles as each experimental unit has exactly two points connected by a straight line. Labels for the experimental units are added for identification.

Individual points are jittered, and open circles are used to alleviate potential overlap and the danger of representing multiple points as a single point. Tick marks are attempted to be chosen wisely. For log-scaled axes in particular, leading digits of 2, 5, and 10 for values are included if possible. Since the algorithm is empirical, the ticklabels argument is available for further refinement or complete replacement of tickmarks.

The heading for the graph is taken from the cgPairedDifferenceData object, which prepareCGPairedDifferenceData sets from its analysisname argument.

The label for the y-axis is taken from the cgPairedDifferenceData object, which prepareCGPairedDifferenceData sets from its endptname and endptunits arguments.

The number of decimal places printed in the ticks on the y-axis is taken from the cgPairedDifferenceData object, which prepareCGPairedDifferenceData sets from its digits argument.

Minimum and maximum values from ranges of data are respectively labeled in the bottom and top left corners of graph regions.

Examples

Run this code
data(anorexia.FT)
anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns",
                                                 analysisname="Anorexia FT",
                                                 endptname="Weight",
                                                 endptunits="lbs",
                                                 expunitname="Patient",
                                                 digits=1, logscale=TRUE)
profileGraph(anorexiaFT.data) 

# Graph the data on the original scale instead of the log scale.
profileGraph(anorexiaFT.data, logscale=FALSE)

Run the code above in your browser using DataLab