tcata.line.plot {tempR} | R Documentation |
Temporal Check-All-That-Apply (TCATA) curve
Description
Plots TCATA curves based on count or proportion data. Can also be used for plotting Temporal Dominance of Sensations (TDS) curves based on dominance counts or proportions.
Usage
tcata.line.plot(X, n = 1, attributes = c(), times = c(),
lwd = 1, lty = 1, line.col = c(),
emphasis = NA, emphasis.col = c(), emphasis.lty = 1, emphasis.lwd = 3,
declutter = NA,
reference = NA, ref.col = c(), ref.lty = 2, ref.lwd = 1,
highlight = FALSE, highlight.col = c(), highlight.lty = 1, highlight.lwd = 5,
xlab = "Time", ylab = "Citation proportion", axes.font = 1,
axes.cex = 1, xlim = c(), las = 0,
x.increment = 5, box = FALSE,
legend.cex = 1, legend.font = 1, legend.pos = "topleft", legend.ncol = 2,
height = 8, width = 12, main = "",
save.format = "", save.as = "" )
Arguments
X |
matrix of proportions (or, if there is no missing data, on counts), typically with Attributes in rows and times in columns. |
n |
The number of observations if |
attributes |
a vector of attribute labels, corresponding to the attributes in |
times |
a vector of time, corresponding to the times in |
lwd |
line width for attribute curves that matches either |
lty |
line types for attribute curves that matches either |
line.col |
attribute curves colours that matches |
emphasis |
matrix matching |
emphasis.col |
vector colours for attributes corresponding to rows of |
emphasis.lty |
either a line type ( |
emphasis.lwd |
line weight associated with the emphasis line. |
declutter |
a matrix with the same dimensions as |
reference |
a matrix with the same dimensions as |
ref.col |
|
ref.lty |
|
ref.lwd |
|
highlight |
TRUE if differences will be highlighted; otherwise FALSE |
highlight.col |
a vector of colours for attributes corresponding to rows of |
highlight.lty |
line type associated with the highlighting |
highlight.lwd |
line weight associated with the highlighting line |
xlab |
label for the x axis |
ylab |
label for the y axis |
axes.font |
font for axes labels; see |
axes.cex |
size for axes labels. |
xlim |
x limits specified using a vector of 2 (ascending) numbers. |
las |
numeric in |
x.increment |
interval between times when labelling the x axis |
box |
draw box around plot area; see: |
legend.cex |
size of markers shown in the legend |
legend.font |
font for the legend; see |
legend.pos |
location of plot legend; defaults to |
legend.ncol |
number of columns in legend |
height |
window height |
width |
window width |
main |
plot title; see |
save.format |
If indicated, this will be the fle type for the save image. Defaults to |
save.as |
Filename if the file will be saved |
References
Castura, J.C., AntĂșnez, L., GimĂ©nez, A., Ares, G. (2016). Temporal check-all-that-apply (TCATA): A novel temporal sensory method for characterizing products. Food Quality and Preference, 47, 79-90. doi:10.1016/j.foodqual.2015.06.017
Meyners, M., Castura, J.C. (2018). The analysis of temporal check-all-that-apply (TCATA) data. Food Quality and Preference, 67, 67-76. doi:10.1016/j.foodqual.2017.02.003
Examples
# example using 'syrah' data set
low1 <- t(syrah[seq(3, 1026, by = 6), -c(1:4)])
colnames(low1) <- 10:180
tcata.line.plot(get.smooth(low1), lwd = 2, main = "Low-ethanol wine (Sip 1)")
# example using 'ojtcata' data set
data(ojtcata)
# comparison of Orange Juice 1 vs. Other OJs (2 to 6)
oj1.v.other <- citation.counts(ojtcata, product.name = "1", product.col = 2,
attribute.col = 4, results.col = 5:25, comparison = "other")
times <- get.times(colnames(ojtcata)[-c(1:4)])
attributes <- unique(ojtcata$attribute)
palettes <- make.palettes(length(attributes))
# plot results
tcata.line.plot(oj1.v.other$P1, n = oj1.v.other$Pn,
attributes = attributes, times = times,
line.col = palettes$pal, reference = oj1.v.other$ref, ref.lty = 3,
declutter = oj1.v.other$declutter, highlight = TRUE, highlight.lwd = 4,
highlight.col = palettes$pal.light,
height = 7, width = 11, legend.cex = 0.7, main = "Product 1 vs. Other Products")
# example showing plots similar to those in Meyners & Castura (2018)
# comparison of Orange Juice 1 vs. All OJs (1 to 6)
oj1.v.all <- citation.counts(ojtcata, product.name = "1", product.col = 2,
attribute.col = 4, results.col = 5:25, comparison = "average")
lty.mat <- matrix(1,nrow=6,ncol=21)
lty.mat[, 1:3] <- c(rep(NA,8),rep(c(1,NA),4), 1, 1)
lty.mat[2, 9:12] <- lty.mat[5, 8] <- 3
tcata.line.plot(oj1.v.all$P1, n = oj1.v.all$Pn, attributes = attributes,
times = times, line.col = palettes$pal, lty = lty.mat, lwd = 2,
height = 7, width = 11, legend.cex = 0.7, main = "Product 1 vs. All Products")