Learn R Programming

fifer (version 1.1)

imageInteraction: Plot an two-way quantitative interaction in an image plot

Description

Plot an two-way quantitative interaction in an image plot

Usage

imageInteraction(data, x, y, z, plot = TRUE, legend = TRUE, ...)

Arguments

data
a data matrix with columns indicating the values of x, y, and z
x
the name of the x variable (a string)
y
the name of the y variable (a string)
z
the name of the z variable (a string)
plot
Should an image be plotted?
legend
add a legend to the plot?
...
other arguments passed to anchored.gradient.

Value

the x range, y range, and image matrix

Details

The image function is quite useful for displaying two-way quantitative interactions (variable X on the X axis, variable Y on the Y axis, and z represented as a color). However, this function requires a matrix where the cells (r_ij) represent the Z value in the ith value of x and jth value of y. Getting it into matrix form can be annoying if it natively comes in long-column format. This function takes a data matrix, conditions as well as z in the columns, and returns an image matrix.

See Also

image

Examples

Run this code
## do this later

Run the code above in your browser using DataLab