Hi, I would like to write text on 2 lines for example. For example, if you have a long sentence and you want to cut it at the 45 caracter and put the continuation underneath! Is it possible? Thanks Sabine --------------------------------- [[alternative HTML version deleted]]
Navarre Sabine wrote:> Hi, > > I would like to write text on 2 lines for example. > For example, if you have a long sentence and you want to cut it at the 45 caracter and put the continuation underneath! > Is it possible?Do you mean for output to console / in plots? Simply insert a "\n" (newline), for example. Uwe Ligges> Thanks > > Sabine > > > --------------------------------- > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> plot(1:10,type="n") > title(main="cut in the 45 char \n new line")pay attention to the \n,which means new line. is it what you want? ======= 2005-07-26 21:59:04 伳侜佋佢伬伌佇伵佒佇佇伌伒伬仯伜======>Hi, > >I would like to write text on 2 lines for example. >For example, if you have a long sentence and you want to cut it at the 45 caracter and put the continuation underneath! >Is it possible? > >Thanks > >Sabine > > >--------------------------------- > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html= = = = = = = = = = = = = = = = = = = 2005-07-26 ------ Deparment of Sociology Fudan University Blog:http://sociology.yculblog.com
On Tue, 26 Jul 2005, Uwe Ligges wrote:> Navarre Sabine wrote:>> I would like to write text on 2 lines for example. >> For example, if you have a long sentence and you want to cut it > at the 45 caracter and put the continuation underneath! >> Is it possible? > > Do you mean for output to console / in plots? > Simply insert a "\n" (newline), for example.And strwrap() will help you insert it in the right place, e.g.> x <- "For example, if you have a long sentence and you want to cut it at the 45 caracter and put the continuation underneath!" > strwrap(x, 45)[1] "For example, if you have a long sentence" [2] "and you want to cut it at the 45 caracter" [3] "and put the continuation underneath!"> paste(strwrap(x, 45), collapse="\n")[1] "For example, if you have a long sentence\nand you want to cut it at the 45 caracter\nand put the continuation underneath!" the latter for use when plotting. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595