Created
June 15, 2012 15:58
-
-
Save geoffalday/2937231 to your computer and use it in GitHub Desktop.
Displays hottest days using R
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
# Nashville's hottest days in 2011 | |
weather2011 <- read.csv('wunder-data-2011.txt', sep=',', header=TRUE) | |
fill_colors <- c() | |
for (i in 1:length(weather2011$tmax)) { | |
if (weather2011$tmax[i] > 80) { | |
fill_colors <- c(fill_colors, '#CC0000') | |
} else { | |
fill_colors <- c(fill_colors, '#CCCCCC') | |
} | |
} | |
barplot(weather2011$tmax, names.arg=weather2011$timestamp, col=fill_colors, border=NA, xlab="Day", ylab="Max Temp", main="Nashville's hottest days in 2011") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment