From: Matthew Walker (firstname.lastname@example.org)
Date: Wed 26 May 2004 - 15:07:43 EST
Please forgive me, I feel exceptionally like a newbie. Although I've
read screeds of documentation, I just can't see how this is done.
I have a data frame that contains a number of pass/fails for certain
variable sizes. From that, I would like to form another data frame that
contains the proportions of pass/fails per variable.
So, for example:
df <- data.frame( Var=c(3,3,3,4,4),
And I'd like to produce the equivalent of:
data.frame( Var=c(3,4), ProportionPass=c(0.33, 1) )
I have found the table() function:
table( df$Var, df$Result)
which potentially seems to be part of the solution, however it turns the
Var column into factors.
As an aside, is the storage of SampleSize (above) the best technique?
Or is it better to store it in a data frame of its own:
data.frame( Var=c(3,4), SamepleSize=c(3,2) )
and then utilise some sort of "lookup" function?
Thank you for your thoughts,
Remail@example.com mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:12 EST