[R] frequency tables

From: Kevin J Emerson <kemerson_at_darkwing.uoregon.edu>
Date: Tue 21 Jun 2005 - 04:38:33 EST


R-masters,

I have a problem that I have been working on for a while and it seems that there may be a simple solution that I have yet to figure out, so I thought that I would venture to post to the help list.

Let's say there was a data.frame with three vectors, two that are factors identifying the data, and one that holds the frequency of occurrence (the events are binary, yes or no). I would like to perform logistic regression on this data, and it seems that I need a vector of 0s and 1s for input into lrm. How might I convert between a frequency table and a vector of binary data while still maintaining all identifier information?

I have thought about using the rep command over and over again and basically building the data.frame "by hand" but that seems long and tedious. Is there a quick and dirty way of doing this?

Thanks in advance!
Kevin

-- 

------------------------------------
------------------------------------
Kevin J Emerson Center for Ecology and Evolutionary Biology 1210 University of Oregon University of Oregon Eugene, OR 97403 kemerson@dakrwing.uoregon.edu ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jun 21 04:48:33 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:54 EST