Alexander Afanasyev | 27370c5 | 2013-03-12 13:54:08 -0700 | [diff] [blame] | 1 | #!/usr/bin/env Rscript |
| 2 | # Copyright (c) 2012-2013 Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 3 | |
| 4 | |
| 5 | # install.packages ('ggplot2') |
| 6 | library (ggplot2) |
| 7 | ## # install.packages ('scales') |
| 8 | ## library (scales) |
| 9 | |
| 10 | ######################### |
| 11 | # Rate trace processing # |
| 12 | ######################### |
| 13 | data = read.table ("drop-trace.txt", header=T) |
| 14 | data$Node = factor (data$Node) |
| 15 | data$Kilobits <- data$Kilobytes * 8 |
| 16 | data$Type = factor (data$Type) |
| 17 | |
| 18 | ## data.rtr = data[grep("Rtr", data$Node),] |
| 19 | |
| 20 | # graph rates on all nodes in Kilobits |
| 21 | g.all <- ggplot (data, aes (x=Time, y=Kilobits, color=Type)) + |
| 22 | geom_point (size=2) + |
| 23 | geom_line () + |
| 24 | ylab ("Packet drop rate [Kbits/s]") + |
| 25 | facet_wrap (~ Node) + |
| 26 | theme_bw () |
| 27 | |
| 28 | png ("drop-trace-all-nodes.png", width=800, height=500) |
| 29 | print (g.all) |
| 30 | x = dev.off () |