Get vector of difference in dominance rates

Description

Get vector of difference in dominance rates

Usage

1
get.differences(x, y)

Arguments

x

matrix of dominance indicators for a single productxattribute (rows = evaluations, columns = times)

y

matrix of dominance indicators for a different product (same attribute)

Value

out vector of differences in dominance rates

References

Pineau, N., Schlich, P., Cordelle, S., Mathonnière, C., Issanchou, S., Imbert, A., Rogeaux, M., Etiévant, P., & Köster, E. (2009). Temporal Dominance of Sensations: Construction of the TDS curves and comparison with time–intensity. Food Quality and Preference, 20, 450–455. http://dx.doi.org/10.1016/j.foodqual.2009.04.005

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# example using 'bars' data set
bars.m <- aggregate(bars[, -c(1:4)], list(samples = bars$sample, attribute = bars$attribute), mean)
bars.m <- bars.m[order(bars.m$sample, bars.m$attribute), ]
attributes <- unique(bars$attribute)
times <- get.times(colnames(bars.m)[-c(1:2)])
bar1 <- bars.m[bars.m$sample == 1 & bars.m$attribute == "Caramelized Flavour", -c(1:2)]
bar2 <- bars.m[bars.m$sample == 2 & bars.m$attribute == "Caramelized Flavour", -c(1:2)]
b.diff <- get.differences(bar1, bar2)
round(b.diff, 3)

# toy example
x <- data.frame(t10 = c( NA,  0,  0,  0,  1,  1,  0,  0,  1,  0, NA),
                t15 = c(  1,  0,  0,  1,  1,  1,  0,  1,  0,  1,  0),
                t20 = c(  1,  1,  1,  1,  1,  1,  1,  0,  1, NA,  0))
y <- data.frame(t10 = c( NA, NA,  0,  0,  1,  1,  0,  0,  0,  0, NA),
                t15 = c(  0,  0,  0,  0,  1,  0,  1,  1,  0,  1,  1),
                t20 = c(  1,  0,  1,  1,  0,  0,  1, NA,  1, NA,  0))
get.differences(x, y)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.