Kurapati, Ravichandra (Ravichandra)
2008-Sep-05 05:21 UTC
[R] how to write a escape sequences in to a file
Hi Str1<-"hai " Str2<-"hru" I want to write these 2 strings in a file separated by newline. How can I get this. Thanks K.Ravichandra [[alternative HTML version deleted]]
A newline is "\n". So "hai \nhru". On Fri, 5 Sep 2008, Kurapati, Ravichandra (Ravichandra) wrote:> > > Hi > > > > Str1<-"hai " > > Str2<-"hru" > > > > I want to write these 2 strings in a file separated by > newline. > > > > > > How can I get this. > > Thanks > > K.Ravichandra > > > > > > > [[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. >-- 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
Henrique Dallazuanna
2008-Sep-05 11:09 UTC
[R] how to write a escape sequences in to a file
Try this: cat(Str1, Str2, file = "out.txt", sep = "\n") On Fri, Sep 5, 2008 at 2:21 AM, Kurapati, Ravichandra (Ravichandra) < ravichandra.kurapati@alcatel-lucent.com> wrote:> > > Hi > > > > Str1<-"hai " > > Str2<-"hru" > > > > I want to write these 2 strings in a file separated by > newline. > > > > > > How can I get this. > > Thanks > > K.Ravichandra > > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]