Skip to content

Instantly share code, notes, and snippets.

@bceskavich
Created February 15, 2015 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bceskavich/3cb72d191eab2f9277de to your computer and use it in GitHub Desktop.
Save bceskavich/3cb72d191eab2f9277de to your computer and use it in GitHub Desktop.
R Bargraph Example
# 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