Skip to content
Prev 378671 / 398502 Next

Dotchart and its arguments

Hi all

I was recently trying to customise a dotchart of a matrix

dats <- matrix(1:6, nrow=2, dimnames=list(R=letters[1:2], C=letters[14:16]))
dotchart(dats)

with pch and pt.cex and noticed some irregularities, namely that R
doesn't use the values in the positions it uses for plotting also for
the arguments of the dotchart function:

dotchart(dats, pch=as.character(dats))       # wrong
dotchart(dats, pch=as.character(dats[,3:1])) # right
dotchart(dats, pch=as.character(dats[,3:1]), pt.cex=dats)       # wrong
dotchart(dats, pch=as.character(dats[,3:1]), pt.cex=dats[,3:1]) # right

Is this a bug or a feature (whose purpose then I don't get)?

Thanks