get.differences {tempR} | R Documentation |
Get vector of difference in dominance rates
Description
Get vector of difference in dominance rates
Usage
get.differences(x, y)
Arguments
x |
matrix of dominance indicators for a single product |
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. doi:10.1016/j.foodqual.2009.04.005
Examples
# example using 'bars' data set
bars.m <- aggregate(bars[, -c(1:4)], list(sample = bars$sample, attribute = bars$attribute), mean)
bars.m <- bars.m[order(bars.m$sample, bars.m$attribute), ]
attributes <- bars.m$attribute[bars.m$sample == 1]
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)
[Package tempR version 0.10.1.1 Index]