I am trying to make dotplot with the lattice and latticeExtra in R However, the correct representation of the values ββon the vertical y axis is not performed. Instead of selecting the actual values ββof a numeric variable, R displays the rank of the value. That is, there are values [375, 500, 625, 750, ..., 3000] , and R displays their ranks [1,2,3,4,...23] and accordingly selects the scale. Does anyone have such a problem? How can I get the correct representation with ticks like (0, 500, 1000, 1500, ...) on the vertical y scale?
Here is the program code:
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))
(Added from the comment below): In addition, can error bars appear on the chart? I thought of the following (to add to the call), but it does not seem to work. Is it possible somehow?
up=z+se, lo=z-se, panel.groups=function(x,y,..., up, lo, subscripts){ up <- up[subscripts] lo <- lo[subscripts] panel.segments(lo, as.numeric(y), up, as.numeric(y), ...) }
Here is my details: https://www.dropbox.com/s/egy25cj00rhum40/data.csv
Added: here is the corresponding piece of data using expand.grid and dput :
df.dose <- expand.grid(effect.size=c(-.5, -.625, -0.75), sample.size=c(40L, 60L, 80L), true.dose=c(375L, 500L, 750L, 1125L), type=c("dose", "categ", "FP2", "FP1")) df.dose$z <- c(875L, 875L, 750L, 750L, 750L, 625L, 625L, 625L, 625L, 875L, 875L, 750L, 1000L, 1000L, 1000L, 1125L, 1000L, 875L, 1000L, 1000L, 875L, 1000L, 1000L, 875L, 1125L, 1000L, 1000L, 1250L, 1125L, 1000L, 1250L, 1250L, 1125L, 1250L, 1000L, 1000L, 500L, 500L, 500L, 500L, 500L, 500L, 500L, 500L, 500L, 625L, 625L, 625L, 625L, 625L, 625L, 625L, 625L, 625L, 750L, 750L, 625L, 750L, 750L, 750L, 750L, 750L, 750L, 875L, 875L, 750L, 750L, 875L, 875L, 875L, 875L, 875L, 2500L, 1500L, 1125L, 2000L, 1000L, 1750L, 250L, 500L, 500L, 1250L, 750L, 625L, 875L, 500L, 500L, 875L, 500L, 375L, 1250L, 875L, 750L, 1000L, 625L, 625L, 875L, 500L, 500L, 1125L, 1000L, 875L, 1125L, 875L, 625L, 1125L, 1000L, 625L, 2500L, 2125L, 2375L, 2000L, 750L, 2625L, 250L, 625L, 250L, 875L, 875L, 500L, 625L, 500L, 625L, 1000L, 500L, 375L, 1000L, 875L, 625L, 875L, 500L, 500L, 875L, 500L, 500L, 1250L, 1125L, 875L, 1125L, 875L, 750L, 1250L, 1000L, 625L)