Skip to content

Exporting each row in the table as new table

3 messages · kallu, R. Michael Weylandt, PIKAL Petr

#
Dear all,

I am new to R and I am familiar with very basic stuff. I am trying to create
tables in text format from each row of my table and export these tables with
specific attribute in the table. I tried after reading some forums but
nothing worked. Can you please help me.

ex:
dataGT

ID	State	Year	Growth
1	IA	1999	25
2	IA	2000	27
3	KS	1999	35
4	KS	2000	31
5	KY	1999	14
6	KY	2000	18
7	NE	1999	34
8	NE	2000	38

I am trying to have each row of the table as new table and need to export
that table with name of of the ID.

Please help me if possible. Thank you
Kalyani




--
View this message in context: http://r.789695.n4.nabble.com/Exporting-each-row-in-the-table-as-new-table-tp4645844.html
Sent from the R help mailing list archive at Nabble.com.
#
On Thu, Oct 11, 2012 at 2:04 PM, kallu <kallut80 at gmail.com> wrote:
Hi Kalyani,

I'm afraid I don't understand your question: what do you mean in this
context by "table"? data frame()s? csv files? And in either case, why
are you splitting into single row objects? When you say "attribute" do
you mean the formal programming construct that is key to many things
in R or something simpler?

In short, could you elaborate further?

Finally, I note you're posting from Nabble. Please include context in
your reply -- I don't believe Nabble does this automatically, so
you'll need to manually include it. Most of the regular respondents on
this list don't use Nabble -- it is a _mailing list_ after all -- so
we don't get the forum view you do, only emails of the individual
posts. Combine that with the high volume of posts, and it's quite
difficult to trace a discussion if we all don't make sure to include
context.

This might also be of help:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Cheers,
Michael
#
Hi
Well, be more specific. How do you want the output by formated based on above example. From what you say it seems to me that you want

split(dataGT, dataGT$id)

but cut me into pieces if I know why.

Regards
Petr