Practical Statistics – 3
So I can draw dots and lines in response to questions now….
library(ggplot2)
library(gridExtra)
for(a in seq(1:4))
{
for(i in seq(1:7))
{
fragment1 <- paste("SmallTreeData$Wilderness_Area", a, "==as.character(1)", sep="")
assign("area", eval(parse(text=fragment1)))
plotindex <- SmallTreeData$Cover_Type==as.character(i)&area
x <- SmallTreeData$Elevation[plotindex]
y <- SmallTreeData$Slope[plotindex]
ScatterPlots <- ggplot(data=SmallTreeData[plotindex,], aes(x = x, y = y)) +
geom_point(color='blue') +
geom_smooth(method = "lm", se = FALSE) +
labs(x = "Elevation",y = "Slope", title=paste("Area", a,"- Cover Type:", i))
filename <- paste("/home/aggitan/Projects/Data_Science/Project_1/Refinement/Lines/Area", a, "Cover",i , ".png", sep="")
ggsave(filename, plot = last_plot())
#listedplot<-assign(paste("p", i, sep=""), ScatterPlots)
#print(listedplot)
#print(ScatterPlot)
}
}
But the problem is that I don't know what any of them mean.
















