Try the table() function.

?table

For example,

df <- data.frame(real=sample(0:1, 20, replace=T), pred=sample(0:1, 20, 
replace=T))
table(df)

    pred
real 0 1
   0 3 7
   1 4 6

Jean


Doussa wrote on 09/02/2011 08:46:42 PM:
> 
> hi users
> I have a data frame in with there are two colomns real values and 
predicted
> ones (for a dichotomic response).
> How can i obtain a confusion matrix (miscalssification rat and errors)?
> The costs are egal.
> 
> Thanks 

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to