[R] Partitioning a large data frame and writing output CSVs

From: joshgage <joshgage_at_gmail.com>
Date: Mon, 02 Jun 2008 17:58:47 -0700 (PDT)


I have a large dataset [536436,4]

I'd like to partition the dataset into 999 groups of 564 rows and output each group as a CSV files... Obviously I could do this longhand but I know it is somehow possible to write a loop to do the same thing...

I'd like to group such that the first group is the first 564 rows, the second group is the second 564 rows ..... the 999th group is the 999th 564 rows...

In each newly created group, I'd like there to be a new column that identifies the group... i.e. the first group would have a new column in which all 564 observations have a character value of "group1"

Finally I'd also like to output each one of these groups as a CSV file with a unique name....

Any help with this is very greatly appreciated....

thanks in advance,


View this message in context: http://www.nabble.com/Partitioning-a-large-data-frame-and-writing-output-CSVs-tp17614022p17614022.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 03 Jun 2008 - 01:54:26 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 Tue 03 Jun 2008 - 06:30:36 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