barchart.CPF | R Documentation |
This is an extension of barchart.array
for
displaying conditional probability tables. In particular, it will
display the output of calcDPCFrame
.
## S3 method for class 'CPF'
barchart(x, data = NULL, ..., baseCol = "firebrick",
auto.key=TRUE, par.settings)
x |
A conditional probaiblity frame (see |
data |
Ignore this value, used for compatability with
|
... |
Other arguments passed on to
|
baseCol |
This should be a specification of a color. The color
is designed as a gradient starting at the base color and getting
progressively lighter. If its value is |
auto.key |
This is the |
par.settings |
This is the |
The function barchart.array
and the function
as.CPA
to convert the conditional probability frame to an array
do 90 percent of the work.
A few minor touches:
The function takes special care of one row [un]conditional probability frames.
The function overrides the default colors using
colorspread
to produce varying intensities of the
same color.
The function adds the dimension names, so that the labels indicate which variables they belong to.
The function sets the default value of auto.key to TRUE
so that a legend for the colors is produced.
Note that the color change is brought about internally by modifying
par.settings
. To suppress this behavior, set baseCol
to
null, and the user value for par.settings
will be passed
through unchanged.
An object of class lattice that when printed will produce the graph.
Russell Almond
as.CPA
, colorspread
,
barchart.array
, calcDPCFrame
## Set up variables
skill1l <- c("High","Medium","Low")
skill2l <- c("High","Medium","Low","LowerYet")
correctL <- c("Correct","Incorrect")
pcreditL <- c("Full","Partial","None")
gradeL <- c("A","B","C","D","E")
cpfTheta <- calcDPCFrame(list(),skill1l,numeric(),0,rule="Compensatory",
link="normalLink",linkScale=.5)
barchart.CPF(cpfTheta)
cptComp <- calcDPCFrame(list(S2=skill2l,S1=skill1l),correctL,
lnAlphas=log(c(1.2,.8)), betas=0,
rule="Compensatory")
barchart.CPF(cptComp,layout=c(3,1))
cptPC1 <- calcDPCFrame(list(S1=skill1l,S2=skill2l),pcreditL,
lnAlphas=log(1),
betas=list(full=c(S1=0,S2=999),partial=c(S2=999,S2=0)),
rule="OffsetDisjunctive")
barchart.CPF(cptPC1,baseCol="slateblue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.