library(Hmisc) library(lattice) # analysis data set adeg <- sasxport.get('//Cdsesub1/evsprod/NDA022034/0011/m5/datasets/iss/analysis/adeg.xpt') adeg$studyidf <- factor(adeg$studyid, levels=levels(adeg$studyid), labels=c('ACT 3','ACT 4','ACT 1','Scene 2','CRAFT','ACT 2')) adeg$armex <- factor(adeg$armex, levels=levels(adeg$armex), labels=c('Placebo','RSD1235-1','RSD1235-2')) # RSD1235-1 and RSD1235-2 correspond to 1 and 2 injections, respectively. # Graph of all ECG parameters ss <- with(subset(adeg, egtptnum%nin%1), summarize(egstresn, llist(egtestcd, egtptnum, armex), mean)) #png('C:/Research/Graphics/Graphs4Display/webpages/classes/pages/images/EGall.png', # width=936, height=625) new.back <- trellis.par.get("background") new.back$col <- "white" newcol <- trellis.par.get("superpose.symbol") newcol$col <- c('blue','black', 'green4') newcol$pch <- c(1,16,4,8) new.line <- trellis.par.get("superpose.line") new.line$col <- c('blue','black', 'green4') new.line$lty <- c(1,1,1,1) new.pan <- trellis.par.get("strip.background") new.pan$col <- c('gray90','white') trellis.par.set("background", new.back) trellis.par.set("superpose.symbol", newcol) trellis.par.set("superpose.line", new.line) trellis.par.set("strip.background",new.pan) xyplot(egstresn~egtptnum|egtestcd, groups=armex, data=ss, type='l', ylab='', xlab='Time of measurement', lwd=2, cex=1, pch=trellis.par.get('superpose.symbol')$pch[1:3], scales=list(x=list(at=c(2,6,9,12,15,16,17,18), labels=c('Base','15m','30','45','2h','4','','24')), y='free'), aspect=1, key=list(x=.7, y=.9, lines=list(type='l', col=trellis.par.get("superpose.symbol")$col[1:3], lty=trellis.par.get('superpose.line')$lty[1:3], lwd=2), text=list( lab=levels(adeg$armex), col=trellis.par.get('superpose.line')$col[1:3]), columns=1, title='Treatment', cex=1.5)) #dev.off()