R Language:
Examine the R expression
pairs(iris[1:4], main="Andersen's Iris Data -- 3 species", pch=20, col=unclass(iris$Species)+2)
Use a similar expression to produce a scatter plot matrix of the variable mpg, disp, hp, drat, and qsec in the data frame mtcars. Use different colors to identify cars belonging to each of the categories defined by the carsize variable.
carsize = cut(mtcars[,"wt"], breaks=c(0, 2.5, 3.5,5.5))#replace
this with the carsize categry yu have
pairs(mtcars[,c(1,3,4,5,7)], main="MT cars plots", pch=20,
col=carsize)
Get Answers For Free
Most questions answered within 1 hours.