This function is a wrapper for the lattice xyplot function.
xpose.plot.default(x,y,object,
inclZeroWRES = FALSE,
onlyfirst = FALSE,
samp = NULL,
panel = xpose.panel.default,
groups = object@Prefs@Xvardef$id,
ids = object@Prefs@Graph.prefs$ids,
logy = FALSE,
logx = FALSE,
yscale.components= "default",#function(...) yscale.components.default(...),
xscale.components= "default",#function(...) xscale.components.default(...), aspect = object@Prefs@Graph.prefs$aspect,
funx = NULL,
funy = NULL,
iplot = NULL,
## Prediction interval settings
PI = NULL,
## Conditioning settings
by=object@Prefs@Graph.prefs$condvar,
force.by.factor = FALSE,
ordby = object@Prefs@Graph.prefs$ordby,
byordfun = object@Prefs@Graph.prefs$byordfun,
shingnum = object@Prefs@Graph.prefs$shingnum,
shingol = object@Prefs@Graph.prefs$shingol,
by.interval = NULL,
strip = function(...){
strip.default(...,strip.names=c(TRUE,TRUE))
},
use.xpose.factor.strip.names=TRUE,
## Subset stuff
subset = xsubset(object),
autocorr=FALSE,
## Axes and titles
main = xpose.create.title(x,y,object,subset,funx,funy,...),
xlb = xpose.create.label(x,object,funx,logx,autocorr.x=autocorr,...),
ylb = xpose.create.label(y,object,funy,logy,autocorr.y=autocorr,...),
scales = list(),
## Superpose smooth
suline = object@Prefs@Graph.prefs$suline,
## Categorical stuff
bwhoriz = object@Prefs@Graph.prefs$bwhoriz,
## Dilution stuff
dilution = FALSE,
dilfrac = object@Prefs@Graph.prefs$dilfrac,
diltype = object@Prefs@Graph.prefs$diltype,
dilci = object@Prefs@Graph.prefs$dilci,
seed = NULL,
mirror = FALSE,
max.plots.per.page=4,
mirror.aspect="fill",
pass.plot.list=FALSE,
x.cex=NULL,
y.cex=NULL,
main.cex=NULL,
mirror.internal=list(strip.missing=missing(strip)),
...)
A string or a vector of strings with the name(s) of the x-variable(s).
A string or a vector of strings with the name(s) of the y-variable(s).
An "xpose.data" object.
A logical value indicating whether rows with WRES=0 should be plotted.
A logical value indicating whether only the first row per individual should be included in the plot.
An integer between 1 and object@Nsim
(seexpose.data-class
) specifying which of the
simulated data sets to extract from SData.
The name of the panel function to use.
A string with the name of any grouping variable (used as
the groups argument to panel.xyplot
.
A logical value indicating whether text labels should be
used as plotting symbols (the variable used for these symbols
indicated by the idlab
xpose data variable).
Logical value indicating whether the y-axis should be logarithmic.
Logical value indicating whether the x-axis should be logarithmic.
Used to change the way the axis look if
logy
is used. Can be a user difined function or
link{xpose.yscale.components.log10}
. If the axes are not log
transformed then
yscale.components.default
is used.
Used to change the way the axis look if
logx
is used. Can be a user difined function or
link{xpose.xscale.components.log10}
. If the axes are not log
transformed then
xscale.components.default
is used.
The aspect ratio of the display (see xyplot
).
String with the name of a function to apply to the x-variable before plotting, e.g. "abs".
String with the name of a function to apply to the y-variable before plotting, e.g. "abs".
Is this an indvidual plots matrix? Internal use only.
Either "lines", "area" or "both" specifying whether
prediction intervals (as lines, as a shaded area or both)
should be computed from the data in SData
and added to the
display. NULL
means no prediction interval.
A string or a vector of strings with the name(s) of the conditioning variables.
Logical value. If TRUE, and by
is not NULL
,
the variable specified by by
is taken as categorical.
A string with the name of a variable to be used to
reorder any factor conditioning variables (by
). The variable
is used in a call to the reorder.factor
function.
The name of the function to be used when reordering a
factor conditioning variable (see argument ordby
)
The number of shingles ("parts") a continuous conditioning variable should be divided into.
The amount of overlap between adjacent shingles (see
argument shingnum
)
The intervals to use for conditioning on a
continuous variable with by
.
The name of the function to be used as the strip argument
to the xyplot
. An easy way to change the strip
appearance is to use strip.custom
. For
example, if you want to change the text in the strips you can use
strip=strip.custom(factor.levels=c("Hi","There"))
if the
by
variable is a factor and
strip=strip.custom(var.name=c("New Name"))
if the
by
variable is continuous.
Use factor names in strips of conditioning plots..
A string giving the plot title or NULL
if none.
A string giving the label for the x-axis. NULL
if none.
A string giving the label for the y-axis. NULL
if none.
A string giving the subset expression to be applied to
the data before plotting. See xsubset
.
Is this an autocorrelation plot? Values can be
TRUE/FALSE
.
A list to be used for the scales
argument in
xyplot
.
A string giving the variable to be used to construct a
smooth to superpose on the display. NULL
if none. This
argument is used if you want to add a superpose line of a variable
not present in the y
list of variables.
A logical value indicating if box and whiskers bars should be plotted horizontally or not. Used when the x-variable(s) is categorical.
Logical value indicating whether data dilution should be used.
Indicating what type of dilution to apply. NULL
means random dilution without stratification. A nonNULL
value
means stratified dilution.
Dilution fraction indicating the expected fraction of individuals to display in the plots. The exact meaning depends on the type of dilution (see below).
A number between 0 and 1 giving the range elegible for dilution in a stratified dilution (see below).
Seed number used for random dilution. NULL
means no
seed.
Should we create mirror plots from simulation data?
Value can be FALSE
, TRUE
or 1
for one mirror
plot, or 3
for three mirror plots.
The maximum number of plots per page that can be created with the mirror plots.
The aspect ratio of the plots used for mirror functionality.
Should we pass the list of plots created with
mirror or should we print them directly. Values can be
TRUE/FALSE
.
The size of the x-axis label.
The size of the y-axis label.
The size of the title.
an internal mirror argument used in
create.mirror
. Checks if the
strip
argument from xyplot
has been used.
Other arguments passed to
xpose.panel.default
.
Returns a xyplot graph object.
y
must be numeric (continuous) while x
can be
either numeric of factor. If x
is numeric then a regular
xy-plot is drawn. If x is a factor, on the other hand, a box and
whiskers plot is constructed.
x
and y
can be either single valued strings or vector of
strings. x
and y
can not both be vectors inthe same call
to the function.
If ids
is TRUE
, text labels are added to the plotting
symbols. The labels are taken from the idlab
xpose data
variable. The way the text labels are plotted is governed by the
idsmode
argument (passed down to the panel
function). idsmode=NULL
(the default) means that only extreme
data points are labelled while a non-NULL
value adds labels to
all data points (the default in Xpose 3). xpose.panel.default
identifies extreme data points by fitting a loess smooth (y~x
)
and looking at the residuals from that fit. Points that are associated
with the highest/lowest residuals are labelled. "High" and "low" are
judged by the panel function parameter idsext
, which gives the
fraction of the total number of data points that are to be judged
extreme in the "up" and "down" direction. The default value for
idsext
is 0.05 (see xpose.prefs-class
). There is
also a possibility to label only the high or low extreme points. This
is done through the idsdir
argument to
xpose.panel.default
. A value of "both" (the default) means that
both high and low extreme points are labelled while "up" and "down"
labels the high and low extreme points respectively.
Data dilution is useful is situations when there is an excessive
amount of data. xpose.plot.default
can dilute data in two
different ways. The first is a completely random dilution in which all
individuals are elegible of exclusion from the plot. In this case the
argument dilfrac
determines the fraction of individuals that
are excluded from the plot. The second type of dilution uses
stratification to make sure that none of the extreme individuals are
omitted from the plot. Extreme individuals are identified in a similar
manner as extreme data points are identified for text labelling. A
smooth is fitted to the data and the extreme residuals from that fit
is used to inform about extremeness. What is judged as extreme is
determined by the argument dilci
, which defaults to 0.95 (Note
that the meaning of this is the opposite to
idsext
). dilci
give the confidence level of the interval
around the fitted curve outside of which points are deemed to be
extreme. Extreme individuals are those that have at least one point in
the "extremeness" interval. Individuals that do not have any extreme
points are elegible for dilution and dilfrac
give the number of
these that should be omitted from the graph. This means that
dilfrac
should usually be grater for stratified dilution than in
completely random dilution. Any smooths added to a diluted plot is
based on undiluted data.
More graphical parameters may be passed to xpose.panel.default
.
xpose.panel.default
,
xyplot
,
panel.xyplot
,
xpose.prefs-class
,
xpose.data-class
## xpdb5 is an Xpose data object
## We expect to find the required NONMEM run and table files for run
## 5 in the current working directory
xpdb5 <- xpose.data(5)
## A spaghetti plot of DV vs TIME
xpose.plot.default("TIME", "DV", xpdb5)
## A conditioning plot
xpose.plot.default("TIME", "DV", xpdb5, by = "SEX")
## Multiple x-variables
xpose.plot.default(c("WT", "SEX"), "CL", xpdb5)
## Multiple y-variables
xpose.plot.default("WT", c("CL", "V"), xpdb5)
xpose.plot.default("WT", c("CL", "V"), xpdb5, by=c("SEX", "HCTZ"))
## determining the interval for the conditioning variable
wt.ints <- matrix(c(50,60,60,70,70,80,80,90,90,100,100,150),nrow=6,ncol=2,byrow=T)
xpose.plot.default("TIME","DV",xpdb5,by="WT", by.interval=wt.ints)
Run the code above in your browser using DataLab