library(MASS) snails attach(snails) HA=Rel.Hum[Species=="A"] HB=Rel.Hum[Species=="B"] TA=Temp[Species=="A"] TB=Temp[Species=="B"] DA=Deaths[Species=="A"] local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE) if(nchar(pkg)) library(pkg, character.only=TRUE)}) scatterplot3d(HA,TA,DA,color="Red",type="h",main="Effect of Relative Humidity and Temperature on Species A",xlab="Relative Humidity",ylab="Temperature", zlab="Deaths",tick.marks=TRUE,, col.axis="darkgoldenrod2", col.grid="darkgoldenrod2", angle=55, scale.y=0.8, pch=23,ylim=c(5:25),xlim=c(55:80))$plane3d(lm(DA~HA+TA),lty.box = "solid") scatterplot3d(HB,TB,DB,color="Blue",type="h",main="Effect of Relative Humidity and Temperature on Species B",xlab="Relative Humidity",ylab="Temperature", zlab="Deaths",tick.marks=TRUE,, col.axis="darkgoldenrod3", col.grid="darkgoldenrod3", angle=55, scale.y=0.8, pch=23,ylim=c(5:25),xlim=c(55:80))$points3d(HB,TB,DB,col=rainbow(12))