Skip to content
Browse files

No commit message

  • Loading branch information...
0 parents commit 681d9f58c8804bf51406cb1f4264683ca5759308 @mat committed Feb 26, 2012
Showing with 88 additions and 0 deletions.
  1. +37 −0 drawhistogram.r
  2. +51 −0 nums
37 drawhistogram.r
@@ -0,0 +1,37 @@
+library(ggplot2)
+
+# R --vanilla < drawhistogram.r
+
+dtaframe <- read.table("data/nums", sep = ";")
+dtaframe2 <- read.table("data/100_000.txt.bz2")
+
+print(range(dtaframe$V2))
+print(summary(dtaframe$V2))
+
+# png("histogram.png")
+# V1
+# m <- ggplot(dtaframe, aes(x=V2))
+# m + geom_histogram()
+
+# v2
+# m <- ggplot(dtaframe, aes(x=V2))
+# m + geom_bar(binwidth=2000)
+
+# v2.2
+# m <- ggplot(dtaframe, aes(x=V2))
+# m + geom_bar(binwidth=4000) + coord_flip()
+
+# v3
+# m <- ggplot(dtaframe2, aes(x=V2))
+# m + geom_histogram()
+
+# v4
+# m <- qplot(dtaframe, aes(x=V2))
+# m + geom_histogram()
+# save(m, file='uuuh.png')
+
+# v5
+m <- ggplot(dtaframe, aes(x=V2))
+m + geom_bar(binwidth=2500) + facet_wrap(~ V1, ncol = 1)
+ggsave(filename="histogram.pdf",width=8.5)
+
51 nums
@@ -0,0 +1,51 @@
+foo;3632
+foo;23508
+foo;17969
+foo;21869
+foo;22498
+foo;16673
+foo;28199
+foo;15916
+foo;17093
+foo;16857
+foo;7148
+foo;19255
+foo;26159
+foo;4275
+foo;27324
+foo;26233
+foo;360
+foo;24935
+foo;25583
+foo;27909
+foo;25457
+foo;23473
+foo;8986
+foo;5894
+foo;4728
+foo;13093
+foo;8165
+foo;29290
+bar;28438
+bar;28598
+bar;14762
+bar;23630
+bar;16136
+bar;11281
+bar;6238
+bar;4519
+bar;24728
+bar;9430
+bar;19236
+baz;21266
+baz;16489
+baz;2897
+baz;8058
+baz;10499
+baz;28872
+baz;26456
+baz;16662
+baz;28580
+baz;31384
+baz;11635
+baz;12035

0 comments on commit 681d9f5

Please sign in to comment.
Something went wrong with that request. Please try again.