Skip to content

dotplot in ".R" with lattice & latticeExtra: proper visualization

2 messages · Andres LaCortadora, David Winsemius

#
Dear everyone,

I'm trying to do a dotplot with the libraries "lattice" and "latticeExtra".
However, no proper representation of the values on the vertical y-axis is
done by ".R". Instead of choosing the actual values of the numeric variable,
".R" plots the rank of the value. That is, there are values [375, 500, 625,
750, ..., 3000] and ".R" plots their ranks [1,2,3,4,...23] and chooses the
scale accordingly. Has someone experienced a problem like this? How can I
manage the get a proper representation with ticks like (0, 500, 1000, 1500,
...) on the vertical y-scale?

Here's my data:
https://www.dropbox.com/s/egy25cj00rhum40/data.csv

And here the program code so far:

df.dose <- read.table("data.csv", sep=",", header=TRUE)
library(lattice); library(latticeExtra)

useOuterStrips(dotplot(z ~ sample.size |
as.factor(effect.size)*as.factor(true.dose),
		       groups=as.factor(type), data=df.dose, as.table=TRUE))

I'd be glad for any kind of help!
Andres



-----
Andres
--
View this message in context: http://r.789695.n4.nabble.com/dotplot-in-R-with-lattice-latticeExtra-proper-visualization-tp4645850.html
Sent from the R help mailing list archive at Nabble.com.
#
On Oct 11, 2012, at 6:48 AM, Andres LaCortadora wrote:

            
I suspect it will be difficult with dotplot. It is expecting a factor variable for the y-value and appears to be coercing the LHS argument to one. Why not use xyplot if you are plotting numeric by numeric? If you what to add horizontal lines `ala` dotplot you could construct a panel that had the appropriate commands.