Learn R Programming

qualityTools (version 1.31.1)

mvPlot: Multi-Vari Charts

Description

Draws a Multi-Vari Chart for 2, 3 or 4 factors

Usage

mvPlot(y, factor1, factor2, factor3, factor4, fun = mean, points = TRUE, connect = TRUE, col = c(1, 2, 3, 4), pch = c(1, 2, 3, 4), xlim, ylim, main, main.sub, horiz = FALSE, lwd.b = 1, lwd.w = 1, pch.b = 15, pch.w = 17, col.w = 2, col.b = 1, ...)

Arguments

y
the values o the response
factor1
settings of factor 1
factor2
settings of factor 2
factor3
settings of factor 3
factor4
settings of factor 4
fun
function to be used for calculation of y for unique settings of the factors e.g. the mean
points
show points
connect
are the means of each factor to be connected
col
graphical parameter
pch
graphical parameter
xlim
graphical parameter
ylim
graphical parameter
main
graphical parameter
main.sub
sub title
horiz
position of the legend
lwd.b
lwd (between)
lwd.w
lwd (within)
pch.b
pch (between)
pch.w
pch (within)
col.w
col (within)
col.b
col (between)
...
further graphical parameters see par

Examples

Run this code
#generate some data
factor1 = c(rep(1, 9), rep(2, 9), rep(3,9))
factor2 = c(rep(1,9), rep(2,9), rep(3,9))
temp = expand.grid(c(1,2,3), c(1,2,3))
temp = as.data.frame(rbind(temp, temp, temp))
temp = cbind(temp, rnorm(27, 20, 2))
names(temp) = c("factor1", "factor2", "response")

#have a look at the design matrix
temp

mvPlot(y = temp[,3], factor1 = temp[,1], factor2 = temp[,2], col.b = "red3", horiz = FALSE)

Run the code above in your browser using DataLab