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

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Thu 02 Jun 2005 - 01:25:14 EST

Vumani Dlamini wrote:

> 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)

Please try to specify *reproducible* examples. For the above example, we do not have the plot and the data. Additionally, the stuff above is not even syntactically correct as e.g. in:

     meanU = round(mle.r$estimate[3),4)))) ),
                                 ^ ^

It has been described in former messages on this list (hence in the mailing list archives) that newlines are not really supported in the "mathematical annotation environment".

Uwe Ligges

> (Windows XP + R2.10 user)
>
> Thanks,
> Vumani
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 02 01:47:17 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:20 EST