[R] "\n" in legend using substitute and as.expression

Vumani Dlamini dvumani at hotmail.com
Wed Jun 1 15:53:01 CEST 2005


Dear R users,
Is it possible to force a hard return in an expression. I tried including 
one for a legend using an expression and it didn't work. Here is my code,
legend(12, 0.10, c("Fitted density",
    as.expression(substitute(paste("Weibull (", alpha==shapeU," , ", 
beta==scaleU,") Mean = ",meanU," days"),
list(shapeU = round(mle.r$estimate[1],3),
         scaleU = round(mle.r$estimate[2],3),
         meanU = round(mle.r$estimate[3),4)))) ),
    lty=c(1,1),col=c(1,2),lwd=c(1,1),merge = TRUE)

(Windows XP + R2.10 user)

Thanks,
Vumani




More information about the R-help mailing list