Skip to content

Instantly share code, notes, and snippets.

@neomatrix369
Created October 18, 2013 16:44
Show Gist options
  • Select an option

  • Save neomatrix369/7044298 to your computer and use it in GitHub Desktop.

Select an option

Save neomatrix369/7044298 to your computer and use it in GitHub Desktop.
R Script to display a simple bar graph
> counts <- table(mtcars$vs, mtcars$gear)
> par(bg = "white");
> barplot(counts, main="Car Distribution by Gears and VS",
xlab="Number of Gears", col=c("darkblue","maroon"),
legend = rownames(counts), beside=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment