Author Login
Post Reply
I have a data set like this
ID=c("A","A","A","A","A","A","A","B","B","B","B","B","B","B")
s=c(1.1,2.2,1.3,1.1,3.1,4.1,4.2,1.1,2.2,1.3,1.1,3.1,4.1,4.2)
d=c(1,2,3,4,5,6,7,1,2,3,4,5,6,7)
t=c(-3,-1,0,1,2,3,4,-3,-2,-1,0,1,2,3)
mydata<-data.frame(cbind(as.character(ID),as.numeric(s),as.integer(d),as.numeric(t)))
colnames(mydata)=c("ID","S","d","t")
attach(mydata)
library(lattice)
Key <- list(text = list(c("FDL", "FDP")), points = list(pch = c("*","o"),col
= c("red", "blue"), cex = 2), space = "right")
xyplot(S ~ d | ID,groups = t < 0,col = c("red", "blue"),pch = c("*",
"o"),scales = list(x = list(at=c(min(d),d[which
(t==0)],max(d)),alternating =c(1,2))),key = Key,cex = 2,type = "b")
Actually, I want to have :
location of tick marks along the axis is:
For A
1,3,7
because for A
min(d)=1
d[which(t==0)]=3
max(d)=7
For B
1,4,7
min(d)=1
d[which(t==0)]=4
max(d)=7
But the location of tick marks along the axis from my code doesn't depend on
A or B.
Does anyone know how to change this?
thanks,
jlfmssm
[[alternative HTML version deleted]]
______________________________________________
R-help@(protected)
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.