Skip to content
Prev 201868 / 398502 Next

layers in xYplot of Hmisc

I took the OP's variables, reversed the "direction" of the second y,  
bundled them up in a dataframe and then assigned the grp. So starting  
with the OP's code:

  x<-seq(1,10,1)
y<-seq(1,10,1)
ci<-y*.10
ciupper<-y+ci
cilower<-y-ci
x2<-seq(1,5,.5)
y2<-seq(5, 1, -.5) #reverse second variable
ci2<-y2*.10
ciupper2<-y2+ci2
cilower2<-y2-ci2
dfci <- data.frame(x =c(x,x2), y=c(y,y2), ciupper=c(ciupper,ciupper2),  
cilower=c(cilower,cilower2) )
  dfci$grp <- 1:19  # "groupify", needed to do it by hand since  
lengths were different
  dfci$grp[1:10] <- 1
  dfci$grp[11:19] <- 2
  dfci$grp <- factor(dfci$grp)
dfci
dput(dfci)
On Nov 27, 2009, at 6:13 AM, butter wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT