Learn R Programming

sensR (version 1.5-2)

plot.samediff: Plot function for samediff objects

Description

This function plots the latent distributions of sensory intensity corresponding to the items or products tested in the discrimination test.

Usage

# S3 method for samediff
plot(x, main = TRUE, length = 1000,
           limits, fig = TRUE, ...)

Arguments

x

The samediff object whose latent distributions are to be plotted

main

include an automatically generated title on the plot? Default is TRUE

length

the length of the vectors to be plotted. Longer vectors gives more smooth curves, but can take a little time.

limits

optional limits on the x-axis; vector of length two.

fig

logical: Should the function create the plot? Defaults to TRUE.

additional arguments to plot and lines

Value

If fig = TRUE, the function will produce the plot. The function invisibly returns a data.frame with elements

z

values for the x-axis of lenght length.

base.dist

y-values for the base distribution of same-samples, ie. a standard normal distribution

delta.dist

y-values for the distribution of different-samples, ie. a normal distribution centred at delta with unit variance.

This facilitates later plotting and changing the appearance of the plot.

Examples

Run this code
# NOT RUN {
## Make same-diff object:
sadi <- samediff(8, 5, 4, 9)
## Plot distributions of sensory intensity:
plot(sadi)
# }

Run the code above in your browser using DataLab