confusion.matrix: confusion.matrix

Description Usage Arguments Value Examples

View source: R/fita.R

Description

Generates the confusion matrix from a categorisation data frame.

Usage

1
confusion.matrix(d, presented, responded, grouping)

Arguments

d

A data.frame containing one trial per row.

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.

Value

A data.frame with the following fieds:

Examples

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))

egaudrain/catRpillar documentation built on Dec. 20, 2021, 3:22 a.m.