Luca De Benedictis wrote:
the dataset I am using (data.it) is organized as follows
...    ...    ...    ...
and plotting it using dotplot, I specified the script as:

library(lattice)
attach(data.ita)
dotplot(reg~stp | partner, data=data.ita, groups=btp,
xlab=list("Data - it",cex=1.5),col=c("black","red"),aspect=0.3,as.table=TRUE,xlim=c(-1,1))
detach(data.ita)


In the resulting plot the variable "reg" is ordered alphabetically. Instead, I would like the variable to be plotted in the following order: "s", "s-f", "d", "d-f".

Make that an ordered factor as follows:


data.it$reg <- ordered(data.it$reg, levels=c("s", "s-f", "d", "d-f"))

hope this helps,

Chuck Cleland

--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to