[tech-spec] Tiny tip for the R neophytes...

  • From: "Vincent C. Fulco" <vfulco@xxxxxxxxxxxxx>
  • To: tech-spec@xxxxxxxxxxxxx
  • Date: Mon, 31 Jan 2005 15:23:11 -0500

For my fellow R beginners, I wanted to throw out a tip I discovered while wrestling with some plots...this is no more than a crumb really, but I found that when using the plot() function, the subtitle (i.e. sub=" ") is too close to the default x-axis label without some tweaking of spacing which I have yet to accomplish.

One can eliminate the subtitle and simply by adding "\n" after the title text and then the subtitle text, you can create a 'line break' in the title and the sub-title will be created right underneath.

I didn't think this type of manipulation was possible *within* the quotes surrounding the title text but I continue to be pleasantly surprised that with R, anything is possible.


Try this-

plot(y, type="l", main="Household Surplus (+) or Deficit (-)\n (Quarterly in $ Bil. SAAR)", xlab="Time", ylab="Values")

instead of this-

plot(y, type="l", main="Household Surplus (+) or Deficit (-)", sub="Quarterly in $ Bil. SAAR", xlab="Time", ylab="Values")


HTH,

Vince Fulco

P.S. CAIA exam in 2 weeks and then I start embarrassing myself with more code posted to the site. Now I know what a performance artist feels like...


Other related posts:

  • » [tech-spec] Tiny tip for the R neophytes...