Skip to content

Instantly share code, notes, and snippets.

@mdigan
Created September 27, 2012 14:58
Show Gist options
  • Select an option

  • Save mdigan/3794477 to your computer and use it in GitHub Desktop.

Select an option

Save mdigan/3794477 to your computer and use it in GitHub Desktop.
Use R to plot a frequency distribution
x = read.table("foo.txt", sep="\t", header=T)
span = seq(0,10, by=1)
span.cut = cut(x$V1, span, right=FALSE)
span.freq = table(span.cut)
cbind(span.freq)
plot(span.freq)
prop.table(span.freq)
cbind(prop.table(span.freq))
plot(prop.table(span.freq))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment