Created
February 15, 2015 21:25
-
-
Save bceskavich/3cb72d191eab2f9277de to your computer and use it in GitHub Desktop.
R Bargraph Example
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
# NEXIS Seminar R Example | |
# | |
# Bar Chart | |
# Create the data frame | |
cities <- c('Buffalo', 'Syrause', 'Binghamton', 'Rochester', 'Albany') | |
snow <- c(75.5, 60.1, 58.7, 54.2, 52.3) | |
snowLevels <- data.frame(cities, snow) | |
print(snowLevels) | |
# Render a barplot with the modified data | |
barplot(snowLevels$snow, | |
names.arg=snowLevels$cities, | |
col='#821122', | |
space=0.3, | |
border=NA, | |
xlab="Cities", | |
ylab="Snow Levels (Inches)", | |
main="Upstate New York Snow Totals (2015), by City" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment