Andras Farkas
2012-Aug-30 13:49 UTC
[R] Help on Plot Title where text is "mixed" with numerical carachters
Dear All, I have the following code set up: x <-2000 y <-8 z <-3 I would need to use these numbers to show up in my plot title "mixed" with text. The x,y,z numbers would need to change, the text would not. So my title should look like this "x txt1 y txt2 z txt3" so if: txt1=hours txt2=minutes txt3=seconds then my title of the plot should read: 2000 hours 8 minutes 3 seconds any thoughts on how to do this would be greatly apreciated thanks, Andras [[alternative HTML version deleted]]
Greg Snow
2012-Aug-30 14:57 UTC
[R] Help on Plot Title where text is "mixed" with numerical carachters
Look at the sprintf and paste functions (either one will do what you describe). On Thu, Aug 30, 2012 at 7:49 AM, Andras Farkas <motyocska at yahoo.com> wrote:> Dear All, > > I have the following code set up: > > x <-2000 > y <-8 > z <-3 > > I would need to use these numbers to show up in my plot title "mixed" with text. The x,y,z numbers would need to change, the text would not. So my title should look like this > > "x txt1 y txt2 z txt3" > > so if: > txt1=hours > txt2=minutes > txt3=seconds > > then my title of the plot should read: 2000 hours 8 minutes 3 seconds > > any thoughts on how to do this would be greatly apreciated > > thanks, > > Andras > [[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. >-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
John Kane
2012-Aug-30 15:06 UTC
[R] Help on Plot Title where text is "mixed" with numerical carachters
?paste plot(1, main = paste(x, "hours", y , "minutes", z , "seconds", sep =" ")) John Kane Kingston ON Canada> -----Original Message----- > From: motyocska at yahoo.com > Sent: Thu, 30 Aug 2012 06:49:04 -0700 (PDT) > To: r-help at r-project.org > Subject: [R] Help on Plot Title where text is "mixed" with numerical > carachters > > Dear All, > > I have the following code set up: > > x <-2000 > y <-8 > z <-3 > > I would need to use these numbers to show up in my plot title "mixed" > with text. The x,y,z numbers would need to change, the text would not. So > my title should look like this > > "x txt1 y txt2 z txt3" > > so if: > txt1=hours > txt2=minutes > txt3=seconds > > then my title of the plot should read: 2000 hours 8 minutes 3 seconds > > any thoughts on how to do this would be greatly apreciated > > thanks, > > Andras > [[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.____________________________________________________________ FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!