Re: [R] Split a string of oneline into 2 lines.

From: A Ezhil <ezhil02_at_yahoo.com>
Date: Wed, 14 May 2008 09:50:18 -0700 (PDT)


Thank you very much. It works !

Ezhil

>
>
> A Ezhil wrote:
> > Hi,
> >
> > I am trying to split a string into 2 separate
> strings
> > in 2 lines. So, tried with
> >
> > sprintf("%s \n %s", "ID", "Name")
> >
> > But R prints: [1] "ID \n Name" instead of
> > ID
> > Name
>
> > Is it something I am missing here?
>
>
> Yes, in order to respect teh control character you
> have to cat() it as in:
>
> cat(sprintf("%s \n %s", "ID", "Name"))
>
> Uwe Ligges
>
>
> > Thanks in advance.
> >
> > Best regards,
> > Ezhil
> >
> > ______________________________________________
> > 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.
>



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. Received on Wed 14 May 2008 - 21:06:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 14 May 2008 - 21:30:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive