Categories selection in R

Viewed 24

I have a dataset with different categories and I want to drow a scatter plot for each one. This is my actual code in R:

data <- mtcars
data <- data[8:14,]
plot(data$wt, data$mpg, main="Scatterplot Example",
     xlab="Car Weight ", ylab="Miles Per Gallon ", pch=19)

Is there a better way to select the categories?

0 Answers
Related