Description Usage Arguments Value Examples
Generates the confusion matrix from a categorisation data frame.
1 | confusion.matrix(d, presented, responded, grouping)
|
d |
A |
presented |
The name of the factor used for the presented category (as a string). |
responded |
The name of the factor used for the responded category (as a string). |
grouping |
A vector of variable names used to group the matrices by. |
A data.frame
with the following fieds:
Presented
containing the name of the presented category
Responded
containing the name of the responded category
Count
the number of occurences
and the factors used for grouping
1 2 3 4 5 6 7 8 | data_cm = confusion.matrix(dat, 'Presented', 'Responded', c('Condition'))
ggplot(data_cm, aes(x=Presented, y=Responded)) +
geom_point(aes(size=Count, colour=Count)) +
scale_colour_viridis_c() +
facet_wrap(~Condition) +
coord_fixed() +
guides(size=F) +
theme(axis.text.x = element_text(angle = 90, hjust=1, vjust=.5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.