Dotchart and its arguments

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Dotchart and its arguments

Robert Zimbardo
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

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.