An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120921/7ab81b0f/attachment.pl>
Math expression in R plot
5 messages · Li Li, Peter Dalgaard, arun +2 more
On Sep 21, 2012, at 17:04 , li li wrote:
Dear all,
In my R plot, I would like to add the title as "Estimator vs. Eta",
where I want to use the greek letter eta.
I was trying to use expression(plain("Estimator vs.") *eta* ). It does not
seem to work.
Can anyone familiar with this give some help?
I'd try dropping the 2nd star. Remember that expressions must be valid R code. You wouldn't be able to say
a <- plain("Estimator vs.") * eta *
either (not even if plain was an actual numeric function and eta a numeric variable).
Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Hi,
Try this:
plot(0,0)
?title(expression(paste(plain("Estimator vs. "),eta,sep=" ")))
A.K.
----- Original Message -----
From: li li <hannah.hlx at gmail.com>
To: r-help <r-help at r-project.org>
Cc:
Sent: Friday, September 21, 2012 11:04 AM
Subject: [R] Math expression in R plot
Dear all,
? In my R plot, I would like to add the title as "Estimator vs. Eta",
where I want to use the greek letter eta.
I was trying to use expression(plain("Estimator? vs.") *eta* ). It does not
seem to work.
Can anyone familiar with this give some help?
? Thank you very much.
? ? ? Hannah
??? [[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
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.
... and she might also want an additional space between "vs. and
"eta", either by inserting it within the quotes explicitly or using:
expression(plain("Estimator vs.")~eta)
-- Bert
On Fri, Sep 21, 2012 at 8:15 AM, peter dalgaard <pdalgd at gmail.com> wrote:
On Sep 21, 2012, at 17:04 , li li wrote:
Dear all,
In my R plot, I would like to add the title as "Estimator vs. Eta",
where I want to use the greek letter eta.
I was trying to use expression(plain("Estimator vs.") *eta* ). It does not
seem to work.
Can anyone familiar with this give some help?
I'd try dropping the 2nd star. Remember that expressions must be valid R code. You wouldn't be able to say
a <- plain("Estimator vs.") * eta *
either (not even if plain was an actual numeric function and eta a numeric variable).
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
______________________________________________ R-help at r-project.org mailing list 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.
Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
On Sep 21, 2012, at 8:19 AM, arun wrote:
Hi,
Try this:
plot(0,0)
title(expression(paste(plain("Estimator vs. "),eta,sep=" ")))
A.K.
Will not throw an error, but perpetuates the misconception that plotmath paste() has a 'sep' argument. The space comes from the first argument and the sep argument if it were visible would occur _after_ the eta.
David.
> ----- Original Message -----
> From: li li <hannah.hlx at gmail.com>
> To: r-help <r-help at r-project.org>
> Cc:
> Sent: Friday, September 21, 2012 11:04 AM
> Subject: [R] Math expression in R plot
>
> Dear all,
> In my R plot, I would like to add the title as "Estimator vs. Eta",
> where I want to use the greek letter eta.
> I was trying to use expression(plain("Estimator vs.") *eta* ). It does not
> seem to work.
> Can anyone familiar with this give some help?
>
> Thank you very much.
> Hannah
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
David Winsemius, MD
Alameda, CA, USA