2013-04-08 42 views
1

我在R中遇到了legend問題。我正在處理生存數據,並且我有兩個卡普蘭梅厄曲線。我需要確定我的情節中的每一個。我使用的傳奇,這是我曾嘗試:錯誤:無法強制(列表)對象輸入「邏輯」添加圖例

plot(kmenfprimaria.dos.inicio, ylab="2B. Probabilidad de supervivencia", 
    family="Times Roman", xlab="Tiempo en días", 
    sub="Mediana: LLA 175 IC 95% (142-295); LMA: 159 IC 95% (59-NR). p(log-rank)=0.783", 
    ps=3, cex.main=0.9, cex.sub=0.7, cex.lab=0.7, 
    main="Supervivencia por diagnóstico", cex.main=0.9, lty=c(1,2), lwd=2, 
    legend(450, 0.8,legend= c("LLA","LMA"), lty=c(1,2), lwd=2)) 

錯誤:(列表)對象不能被強制鍵入「邏輯」

我不知道該怎麼要挾的對象是什麼。

回答

0

legend不是一個參數plot,你需要調用plot()然後legend()

plot(kmenfprimaria.dos.inicio, ylab="2B. Probabilidad de supervivencia", 
family="Times Roman", xlab="Tiempo en días", 
sub="Mediana: LLA 175 IC 95% (142-295); LMA: 159 IC 95% (59-NR). p(log-rank)=0.783", 
ps=3, cex.main=0.9, cex.sub=0.7, cex.lab=0.7, 
main="Supervivencia por diagnóstico", cex.main=0.9, lty=c(1,2), lwd=2) 

legend(450, 0.8,legend= c("LLA","LMA"), lty=c(1,2), lwd=2) 
+0

感謝!!!!!!你讓它發生! – 2013-04-08 01:49:34

相關問題