[R] Unable to get Legend with survplot rms package

Aric Gregson agregson at mednet.ucla.edu
Mon Oct 26 20:56:10 CET 2009


Hello,

I apologize for the post as I am certainly overlooking a simple
solution to my difficulties with getting a legend to print on a
survplot from the rms package.

I am plotting the following:

survplot(survest(fita), n.risk=T, conf='none', cex.n.risk=.85, dots=T,
col='gray10', lty=2)
survplot(survest(fit), n.risk=F, conf='none', add=T)
survplot(survest(fitb), n.risk=F, conf='none', col='gray20', add=T,
lty=4)

I have tried to place 'label.curves=list(method="arrow", cex=.8)' and
others as suggested in ?survplot in any and all of the above commands,
but I do not get a legend regardless of whether I try to plot only one
or several lines as above. Any suggestions as to how I can generate a
legend would be greatly appreciated.

Thanks, Aric


sessionInfo()
R version 2.9.2 (2009-08-24)
i386-pc-solaris2.11

locale:
C

attached base packages:
 [1] splines   grid      tools     stats     graphics  grDevices
utils [8] datasets  methods   base

other attached packages:
 [1] rms_2.0-2          rankhazard_0.8     latticist_0.9-42
vcd_1.2-4 [5] colorspace_1.0-1   MASS_7.2-48        latticeExtra_0.6-1
RColorBrewer_1.0-2 [9] lattice_0.17-25    Hmisc_3.7-0
survival_2.35-4    ggplot2_0.8.3 [13] reshape_0.8.3
plyr_0.1.9         proto_0.3-8        fortunes_1.3-6

loaded via a namespace (and not attached):
[1] cluster_1.12.0  gWidgets_0.0-37 tcltk_2.9.2

IMPORTANT WARNING:  This email (and any attachments) is ...{{dropped:9}}




More information about the R-help mailing list