Learn R Programming

xpose4 (version 4.5.0)

cat.dv.vs.idv.sb: Categorical observations vs. idependent variable using stacked bars.

Description

Categorical observations vs. idependent variable using stacked bars.

Usage

cat.dv.vs.idv.sb(object,
           dv=xvardef("dv",object),
           idv=xvardef("idv",object),
           by=NULL,
           groups=dv,
           force.by.factor = FALSE,
           recur=F,
           xlb=idv,
           ylb="Proportion",
           subset=NULL,
           vary.width=T,
           level.to.plot=NULL,
           refactor.levels=TRUE,
           main=xpose.create.title.text(idv,dv,
             "Proportions of",object,subset=subset,...),
           stack=TRUE,
           horizontal=FALSE,

strip = function(...) strip.default(...,strip.names=c(TRUE,TRUE)), scales = list(), inclZeroWRES = TRUE, onlyfirst = FALSE, samp = NULL, aspect = object@Prefs@Graph.prefs$aspect, auto.key = "Default", ## mirror stuff mirror = FALSE, mirror.aspect="fill", pass.plot.list=FALSE, x.cex=NULL, y.cex=NULL, main.cex=NULL, mirror.internal=list(strip.missing=missing(strip)), ...)

Arguments

object
Xpose data object.
dv
The dependent variable (e.g. "DV" or "CP".)
idv
The indenpent variable (e.g. "TIME".)
by
Conditioning variable
groups
How we should group values in each conditional plot.
force.by.factor
Should we force the data to be treated as factors?
recur
Not used.
xlb
A string giving the label for the x-axis. NULL if none.
ylb
A string giving the label for the y-axis. NULL if none.
subset
Subset of data.
vary.width
Should we vary the width of the bars to match amount of information?
level.to.plot
Which levels of the DV to plot.
refactor.levels
Should we refactor the levels?
main
The title of the plot.
stack
Should we stack the bars?
horizontal
Should the bars be horizontal?
strip
Defining how the strips should appear in the conditioning plots.
scales
Scales argument to xyplot.
inclZeroWRES
Include rows with WRES=0?
onlyfirst
Only include first data point for each individual?
samp
Sample to use in mirror plot (a number).
aspect
Aspect argument to xyplot.
auto.key
Make a legend.
mirror
Mirror can be FALSE, TRUE, 1 or 3.
mirror.aspect
Aspect for mirror.
pass.plot.list
Should the plot list be passsed back to user?
x.cex
Size of x axis label.
y.cex
Size of Y axis label.
main.cex
Size of Title.
mirror.internal
Internal stuff.
...
Other arguments passed to function.

Examples

Run this code
## read in table files
runno <- 45
xpdb <- xpose.data(runno)

## make some stacked bar plots
cat.dv.vs.idv.sb(xpdb,idv=NULL,stack=F)
cat.dv.vs.idv.sb(xpdb,idv=NULL,stack=F,by="DOSE")
cat.dv.vs.idv.sb(xpdb,idv="DOSE")
cat.dv.vs.idv.sb(xpdb,idv=NULL,stack=F,by="TIME")
cat.dv.vs.idv.sb(xpdb,idv="TIME")
cat.dv.vs.idv.sb(xpdb,idv="CAVH")
cat.dv.vs.idv.sb(xpdb,idv="TIME",by="DOSE",scales=list(x=list(rot=45)))

## make some mirror plots
cat.dv.vs.idv.sb(xpdb,idv="DOSE",mirror=1)
cat.dv.vs.idv.sb(xpdb,idv="CAVH",mirror=1,auto.key=F)

Run the code above in your browser using DataLab