Re: [R] write every element of a variable into a separate text-file

From: Michael Dewey <info_at_aghmed.fsnet.co.uk>
Date: Sun, 23 Nov 2008 09:31:32 +0000

At 13:39 21/11/2008, zuber_at_hs-heilbronn.de wrote:
>Hello,
>
>what I want to do, is, to write every element of a variable into a
>separate text-file automatically:

I think this may be FAQ 7.34 How can I save the result of each iteration in a loop into a separate file?

>My Variable:
>
> > wull
>[1] "Hallo Leute, wie gehts denn euch seid ihr noch alle..."
>[2] "Is their anyone how can help me with..."
>[3] "mann, mann, mann... das nervt aber.."
>[4] "how are you littele strange tiger..."
>[5] ")()()(UJKJKJIJIJJOO9989////////////"
>[6] "bradortslow, eiwudoiude, kdkdkdk:::idjidji"
>
>I was trying to do things like that:
>
> > for (i in seq(along = wull))
>+ write(wull[i], ("C://Users//zuber//Documents//wull(1).txt"),
>+ append = F)
>
>But what I get is just the last element [6] ("bradortslow, eiwudoiude,
>kdkdkdk:::idjidji") of my variable in just one text-file.
>
> - I do not know, how to say to R, that it should write:
>
>[1] "Hallo Leute, wie gehts denn euch seid ihr noch alle..." in
>"wull(1).txt"
>
>[2] "Is their anyone how can help me with..." in "wull(2).txt"
>
>[3] "mann, mann, mann... das nervt aber.." in "wull(3).txt"
>
>... an so on till the last element.
>
>
>I hope this is possible and someone can help me.
>
>
>Martin

Michael Dewey
http://www.aghmed.fsnet.co.uk



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 Sun 23 Nov 2008 - 09:35:38 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 Sun 23 Nov 2008 - 10:30:28 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