[R] convert count data to binary data

From: Christopher G Oakley <coakley_at_bio.fsu.edu>
Date: Fri, 06 May 2011 16:15:04 -0400


Is there a way to generate a new dataframe that produces x lines based on the contents of a column?

for example: I would like to generate a new dataframe with 70 lines of data[1, 1:3], 67 lines of data[2, 1:3], 75lines of data[3,1:3] and so on up to numrow = sum(count).

> data

pop fam yesorno count

1 126         1    70
1 127         1    67
1 128         1    75
1 126         0    20
1 127         0    23
1 128         0    15


Thanks,

Chris

Department of Biological Science
Florida State University
319 Stadium Drive
Tallahassee, FL 32306-4295



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 Sat 07 May 2011 - 00:47:01 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Sat 07 May 2011 - 02:10:06 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