[R] legend

threshold r.kozarski at gmail.com
Wed Sep 22 19:39:12 CEST 2010


Hi,
there is a function to plot survival curves:

library(survival)
plot.KM <- function(survival, x, x_cut.off, main='', label='')
{
plot(survfit(survival ~ I(x >= x_cut.off)), main=main)
legend('bottomleft', c(expression(label >= x_cut.off),expression(label <
x_cut.off)))
}

Now, I need to determine as the argument what appears in the legend. I want
plot.KM(survival, x, x_cut.off=0.5, main='', label='ABC')
but what I get is ('label < x_cut.off') in legend instead of 'ABC<0.5'.
Symbol '>=' should be in mathematical form. will appreciate any help.

robert


-- 
View this message in context: http://r.789695.n4.nabble.com/legend-tp2550747p2550747.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list