library (lattice)
attach(mtcars)
head(mtcars)
gear.f<-factor(gear,levels=c(3,4,5),labels=c("3gears","4gears","5gears"))
cyl.f<-factor(cyl,levels=c(4,6,8),labels=c("4cyl","6cyl","8cyl"))
densityplot(~mpg|cyl.f,main="Density Plot by Number of Cylinders",xlab="Miles Per Gallon",layout=c(1,3))
bwplot(~mpg|cyl.f,main="Density Plot by Number of Cylinders",xlab="Miles Per Gallon",layout=c(1,3))
dotplot(~mpg|cyl.f,main="Density Plot by Number of Cylinder",xlab="Miles per Gallon ",layout=c(1,3))

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: