Walmes Zeviani
2011-Jun-02 21:03 UTC
[R] Use line break at scrip but avoid line break on graphics
Hello list, I have plots with long strings in main=, ylab= or xlab=. So, in I my script I use break long lines to avoid lines hiden on my monitor and in sweave document pages. I use graphics like this plot(1, main="aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb") but I would like a plot result like this plot(1, main="aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb") I remember once I saw a meta character like "\n" that avoid this breack line plot(1, main="aaaaaaaaaaaaaaaaaaaa\(?) bbbbbbbbbbbbbbbbbbbb") Does someone know that? Thanks. Walmes =========================================================================Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) Departamento de Estatística - Universidade Federal do Paraná fone: (+55) 41 3361 3573 VoIP: (3361 3600) 1053 1173 e-mail: walmes@ufpr.br twitter: @walmeszeviani homepage: http://www.leg.ufpr.br/~walmes linux user number: 531218 ========================================================================= [[alternative HTML version deleted]]
Rolf Turner
2011-Jun-02 22:13 UTC
[R] Use line break at scrip but avoid line break on graphics
On 03/06/11 09:03, Walmes Zeviani wrote:> Hello list, > > I have plots with long strings in main=, ylab= or xlab=. So, in I my script > I use break long lines to avoid lines hiden on my monitor and in sweave > document pages. I use graphics like this > > plot(1, main="aaaaaaaaaaaaaaaaaaaa > bbbbbbbbbbbbbbbbbbbb") > > but I would like a plot result like this > > plot(1, main="aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb") > > I remember once I saw a meta character like "\n" that avoid this breack line > > plot(1, main="aaaaaaaaaaaaaaaaaaaa\(?) > bbbbbbbbbbbbbbbbbbbb") > > Does someone know that?I think that plot(1,main=paste("aaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbb")) might do what you want. cheers, Rolf Turner
Peter Langfelder
2011-Jun-02 22:16 UTC
[R] Use line break at scrip but avoid line break on graphics
On Thu, Jun 2, 2011 at 3:13 PM, Rolf Turner <rolf.turner at xtra.co.nz> wrote:> On 03/06/11 09:03, Walmes Zeviani wrote: >> >> Hello list, >> >> I have plots with long strings in main=, ylab= or xlab=. So, in I my >> script >> I use break long lines to avoid lines hiden on my monitor and in sweave >> document pages. I use graphics like this >> >> plot(1, main="aaaaaaaaaaaaaaaaaaaa >> ? ? ? ? ? ? ? bbbbbbbbbbbbbbbbbbbb") >> >> but I would like a plot result like this >> >> plot(1, main="aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb") >> >> I remember once I saw a meta character like "\n" that avoid this breack >> line >> >> plot(1, main="aaaaaaaaaaaaaaaaaaaa\(?) >> ? ? ? ? ? ? ? bbbbbbbbbbbbbbbbbbbb") >> >> Does someone know that? > > I think that > > ? ?plot(1,main=paste("aaaaaaaaaaaaaaaaaaaa", > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "bbbbbbbbbbbbbbbbbbbb")) > > might do what you want.I think he needs plot(1,main=paste("aaaaaaaaaaaaaaaaaaaa\n", "bbbbbbbbbbbbbbbbbbbb", sep = "")) or simply plot(1, main="aaaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbb") Peter
David Winsemius
2011-Jun-02 22:30 UTC
[R] Use line break at scrip but avoid line break on graphics
On Jun 2, 2011, at 6:13 PM, Rolf Turner wrote:> On 03/06/11 09:03, Walmes Zeviani wrote: >> Hello list, >> >> I have plots with long strings in main=, ylab= or xlab=. So, in I >> my script >> I use break long lines to avoid lines hiden on my monitor and in >> sweave >> document pages. I use graphics like this >> >> plot(1, main="aaaaaaaaaaaaaaaaaaaa >> bbbbbbbbbbbbbbbbbbbb") >> >> but I would like a plot result like this >> >> plot(1, main="aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb") >> >> I remember once I saw a meta character like "\n" that avoid this >> breack line >> >> plot(1, main="aaaaaaaaaaaaaaaaaaaa\(?) >> bbbbbbbbbbbbbbbbbbbb") >> >> Does someone know that? > > I think that > > plot(1,main=paste("aaaaaaaaaaaaaaaaaaaa", > "bbbbbbbbbbbbbbbbbbbb"))Look, Ma, no quotes! Er, well, maybe one "quote". plot(1, main=quote(aaaaaaaaaaaaaaaaaaaa~ bbbbbbbbbbbbbbbbbbbb) ) -- David Winsemius, MD West Hartford, CT
Duncan Murdoch
2011-Jun-03 00:48 UTC
[R] Use line break at scrip but avoid line break on graphics
On 02/06/2011 5:03 PM, Walmes Zeviani wrote:> Hello list, > > I have plots with long strings in main=, ylab= or xlab=. So, in I my script > I use break long lines to avoid lines hiden on my monitor and in sweave > document pages. I use graphics like this > > plot(1, main="aaaaaaaaaaaaaaaaaaaa > bbbbbbbbbbbbbbbbbbbb") > > but I would like a plot result like this > > plot(1, main="aaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbb") > > I remember once I saw a meta character like "\n" that avoid this breack line > > plot(1, main="aaaaaaaaaaaaaaaaaaaa\(?) > bbbbbbbbbbbbbbbbbbbb") > > Does someone know that? >I suspect you are thinking of LaTeX or some other language; as far as I know there is no way to avoid including the break within a string in R source files. There is one slightly ugly possibility if you are using Sweave: put the source all on one line, but then post-process the output to wrap it. Duncan Murdoch
Maybe Matching Threads
- ternary contour plot
- multcomp::glht() doesn't work for an incomplete factorial using aov()?
- Lattice densityplot with semitransparent filled regions
- How to provide a result from D(f(x), "x") to a curve(f'(x)) ???
- xtable with conditional formatting using \textcolor