John Sorkin
2009-Aug-10 15:35 UTC
[R] Produce single line graph title composed of text and computed values.
R 2.81 Windows XP I am trying to produce a title that combines: text, a computed value, text, a computed value The title contains everything I want, but each element of the title is on a separate line, i.e. my title is five lines long. Is there anyway I can force the entire title to be on the same line? The problem is not the length of the title; it is short enough to fit on a shingle line. My R code follows: title(c(text,"Corr=",round(corrln$estimate,2),"p=",round(corrln$p.value,2))) Thanks, John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}}
Sarah Goslee
2009-Aug-10 15:40 UTC
[R] Produce single line graph title composed of text and computed values.
You need to use paste() instead of c(). Sarah On Mon, Aug 10, 2009 at 11:35 AM, John Sorkin<jsorkin at grecc.umaryland.edu> wrote:> R 2.81 > Windows XP > > > I am trying to produce a title that combines: > text, a computed value, text, ?a computed value > > The title contains everything I want, but each element of the title is on a separate line, i.e. my title is five lines long. Is there anyway I can force the entire title to be on the same line? The problem is not the length of the title; it is short enough to fit on a shingle line. > > My R code follows: > > title(c(text,"Corr=",round(corrln$estimate,2),"p=",round(corrln$p.value,2))) > > Thanks, > John >-- Sarah Goslee http://www.functionaldiversity.org
Erik Iverson
2009-Aug-10 15:42 UTC
[R] Produce single line graph title composed of text and computed values.
See the ?paste function, instead of the ?c function. -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of John Sorkin Sent: Monday, August 10, 2009 10:36 AM To: r-help at r-project.org Subject: [R] Produce single line graph title composed of text and computed values. R 2.81 Windows XP I am trying to produce a title that combines: text, a computed value, text, a computed value The title contains everything I want, but each element of the title is on a separate line, i.e. my title is five lines long. Is there anyway I can force the entire title to be on the same line? The problem is not the length of the title; it is short enough to fit on a shingle line. My R code follows: title(c(text,"Corr=",round(corrln$estimate,2),"p=",round(corrln$p.value,2))) Thanks, John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:9}}