Question

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...

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.

Homework Answers

Answer #1

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)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions