[R] other way of making a table?

2012-10-09 Thread Jessica Streicher
I'm making tables for prediction results of classifiers (2 classes) that show the usual numbers, true positives, false positives, etc I used the command table(predictedLabels,realLabels) to make those. I just had a case though ,where one of the label vectors had only one class in it. This

Re: [R] other way of making a table?

2012-10-09 Thread Jeff Newmiller
Use factors? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead:

Re: [R] other way of making a table?

2012-10-09 Thread Jessica Streicher
So.. real=factor(realLabels) predicted=factor(predictedLabels) fl-unique(levels(real),levels(predicted)) real=factor(realLabels,fl) predicted=factor(pl,fl) table(real,predicted) ? i kinda dont like

Re: [R] other way of making a table?

2012-10-09 Thread Jorge I Velez
Dear Jessica, Compare x-c(1,1,1,0,0) y-c(1,1,1,1,1) table(x, y) with table(factor(x, levels = 0:1), factor(y, levels = 0:1)) HTH, Jorge.- On Wed, Oct 10, 2012 at 12:24 AM, Jessica Streicher wrote: So.. real=factor(realLabels)

Re: [R] other way of making a table?

2012-10-09 Thread Duncan Murdoch
On 09/10/2012 9:24 AM, Jessica Streicher wrote: So.. real=factor(realLabels) predicted=factor(predictedLabels) fl-unique(levels(real),levels(predicted)) real=factor(realLabels,fl) predicted=factor(pl,fl)

Re: [R] other way of making a table?

2012-10-09 Thread Jessica Streicher
Yepp, i do not necessarily know them beforehand. Or maybe i should rather say that they may differ from time to time but i want to be able to just copy the code. I can use your code that skips the first factor commands though, thanks. On 09.10.2012, at 15:00, Jeff Newmiller wrote: Use