Anna Cecilia Lawson McLean
2015-Oct-25 14:17 UTC
[R] Modifying graphs in 'survrec' package
Dear all, I am new to R and I am using the package 'survrec'. I would like to modify the colors and lines in graphs with multiple groups. The package includes this example: data(colon) fit<-survfitr(Survr(hc,time,event)~as.factor(dukes),data=colon,type="pena") Using the arguments "col" or "lty" has not worked: plot(fit,ylim=c(0,1),xlim=c(0,2000), col=c("red", "blue", "orange"), lty=3) I would be very grateful for any help! Thank you very much in advance! Kind regards, Anna McLean [[alternative HTML version deleted]]
As answered here: http://stackoverflow.com/a/33331444/1457051 palette(c("red", "blue", "orange")) par(lty=3) plot(fit,ylim=c(0,1),xlim=c(0,2000)) though, as indicated in that post, you'll need to customize the survrec:::plot.survfitr function to do more detailed customization. On Sun, Oct 25, 2015 at 10:17 AM, Anna Cecilia Lawson McLean <anna.lawsonmclean at gmail.com> wrote:> Dear all, > > I am new to R and I am using the package 'survrec'. I would like to modify > the colors and lines in graphs with multiple groups. The package includes > this example: > > data(colon) > fit<-survfitr(Survr(hc,time,event)~as.factor(dukes),data=colon,type="pena") > > Using the arguments "col" or "lty" has not worked: > > plot(fit,ylim=c(0,1),xlim=c(0,2000), col=c("red", "blue", "orange"), lty=3) > > > I would be very grateful for any help! Thank you very much in advance! > > Kind regards, > > Anna McLean > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.