Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread John Kane
--- Farrel Buchinsky [EMAIL PROTECTED] wrote: How do you create a table from a data frame? I tried as.table( name.of.data.frame) but it bombed out. I will include the exact error message in my next posting. If I recall correctly, it said that the data.frame could not be coerced to a

Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
No. Not really.What you have done seems to be similar to what I could do with the reshape library. rawer-melt(coinfection,id.var=study) # please refer to my post immediately before this. I am still unable to make use of prop.table and margin.table functions. On 10/3/07, Deepayan Sarkar [EMAIL

Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Deepayan Sarkar
On 10/3/07, Farrel Buchinsky [EMAIL PROTECTED] wrote: Thank you. It comes close but not exactly what I wanted. I had to scrap my column that contained character values. That column noted the name of the study. Let me try show you here Best if viewed in courier font coinfection

Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
Thank you. It comes close but not exactly what I wanted. I had to scrap my column that contained character values. That column noted the name of the study. Let me try show you here Best if viewed in courier font coinfection study HPV6 HPV11 CoInfect other 1 Wiatrak 2004 3123

Re: [R] Calculating proportions from a data frame rather than a table

2007-10-03 Thread Farrel Buchinsky
Incidentally, the feature becomes really powerful when one uses functions such as addmargins together with prop.table as in coinf.table -as.matrix(coinfection) prop.table(coinf.table,1) # to see proportions from each HPV type per study addmargins(coinf.table)# to see totals within study and

[R] Calculating proportions from a data frame rather than a table

2007-10-02 Thread Farrel Buchinsky
When one has raw data it is easy to create a table of one variable against another and then calculate proportions For example a.nice.table-table(a,b) prop.table(a.nice.table,1) However, I looked at several papers and created a data frame of the aggregate data. That means I acually created a table

Re: [R] Calculating proportions from a data frame rather than a table

2007-10-02 Thread Farrel Buchinsky
How do you create a table from a data frame? I tried as.table( name.of.data.frame) but it bombed out. I will include the exact error message in my next posting. If I recall correctly, it said that the data.frame could not be coerced to a table. On 10/2/07, John Kane [EMAIL PROTECTED] wrote: