Created
January 29, 2017 21:56
-
-
Save Thermoflux/90e052535d16a3114dfd7d06dbb8e544 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = "Histogram of US" | |
extn = ".jpeg" | |
name = paste(name,extn) | |
jpeg(name) | |
par(mfrow=c(3, 1)) | |
for (i in c(1,3)) { | |
tempvar2 <- Crime[,c(132,130,136)] | |
colnames <- colnames(tempvar2) | |
hist(as.numeric(tempvar2[,i]), xlim=c(0, max(as.numeric(tempvar2[,i])+10)), breaks=seq(0, max(as.numeric(tempvar2[,i])+10), 10), | |
main=colnames[i], probability=TRUE, col=i*2, border="black",xlab=colnames[i]) | |
} | |
tempvar3 <- subset(tempvar2,tempvar2$murders>100) | |
i = 2 | |
hist(as.numeric(tempvar3[,1]), xlim=c(0, max(as.numeric(tempvar3[,1])+10)), breaks=18, | |
main=colnames[i], probability=TRUE, col=i*2, border="black",xlab=colnames[i]) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment