docs: Documentation update

Change-Id: I6f916eb822a59e980e8fb1134886c3431755119c
diff --git a/examples/graphs/drop-graph.R b/examples/graphs/drop-graph.R
index 0f28f6e..bb04161 100755
--- a/examples/graphs/drop-graph.R
+++ b/examples/graphs/drop-graph.R
@@ -1,30 +1,30 @@
 #!/usr/bin/env Rscript
-# Copyright (c) 2012-2013  Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+# Copyright (c) 2012-2015  Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 
 
 # install.packages ('ggplot2')
-library (ggplot2)
+library(ggplot2)
 ## # install.packages ('scales')
 ## library (scales)
 
 #########################
 # Rate trace processing #
 #########################
-data = read.table ("drop-trace.txt", header=T)
-data$Node = factor (data$Node)
+data = read.table("drop-trace.txt", header=T)
+data$Node = factor(data$Node)
 data$Kilobits <- data$Kilobytes * 8
-data$Type = factor (data$Type)
+data$Type = factor(data$Type)
 
 ## data.rtr = data[grep("Rtr", data$Node),]
 
 # graph rates on all nodes in Kilobits
-g.all <- ggplot (data, aes (x=Time, y=Kilobits, color=Type)) +
-  geom_point (size=2) +
-  geom_line () +
-  ylab ("Packet drop rate [Kbits/s]") +
-  facet_wrap (~ Node) +
-  theme_bw ()
+g.all <- ggplot(data, aes(x=Time, y=Kilobits, color=Type)) +
+  geom_point(size=2) +
+  geom_line() +
+  ylab("Packet drop rate [Kbits/s]") +
+  facet_wrap(~ Node) +
+  theme_bw()
 
-png ("drop-trace-all-nodes.png", width=800, height=500)
-print (g.all)
-x = dev.off ()
+png("src/ndnSIM/docs/source/_static/l2-rate-tracer.png", width=800, height=500)
+print(g.all)
+x = dev.off()
diff --git a/examples/graphs/rate-graph.R b/examples/graphs/rate-graph.R
index 6d63298..cbacf49 100755
--- a/examples/graphs/rate-graph.R
+++ b/examples/graphs/rate-graph.R
@@ -1,88 +1,47 @@
-# Copyright (c) 2012  Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+# Copyright (c) 2012,2015  Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 
-# install.packages ('ggplot2')  
-library (ggplot2)
-# install.packages ('scales')  
-library (scales)
+# install.packages('ggplot2')
+library(ggplot2)
+# install.packages('scales')
+library(scales)
 
-# install.packages ('doBy')
-library (doBy)
+# install.packages('doBy')
+library(doBy)
 
 #########################
 # Rate trace processing #
 #########################
-data = read.table ("rate-trace.txt", header=T)
-data$Node = factor (data$Node)
+data = read.table("rate-trace.txt", header=T)
+data$Node = factor(data$Node)
 data$FaceId <- factor(data$FaceId)
 data$Kilobits <- data$Kilobytes * 8
-data$Type = factor (data$Type)
+data$Type = factor(data$Type)
 
 # exlude irrelevant types
-data = subset (data, Type %in% c("InInterests", "OutInterests", "InData", "OutData"))
+data = subset(data, Type %in% c("InInterests", "OutInterests", "InData", "OutData"))
 
 # combine stats from all faces
-data.combined = summaryBy (. ~ Time + Node + Type, data=data, FUN=sum)
-  
+data.combined = summaryBy(. ~ Time + Node + Type, data=data, FUN=sum)
+
 data.root = subset (data.combined, Node == "root")
-data.leaves = subset (data.combined, Node %in% c("leaf-1", "leaf-2", "leaf-3", "leaf-4"))
+data.leaves = subset(data.combined, Node %in% c("leaf-1", "leaf-2", "leaf-3", "leaf-4"))
 
 # graph rates on all nodes in Kilobits
-g.all <- ggplot (data.combined) +
-  geom_point (aes (x=Time, y=Kilobits.sum, color=Type), size=1) +
-  ylab ("Rate [Kbits/s]") +
-  facet_wrap (~ Node)
+g.all <- ggplot(data.combined) +
+  geom_point(aes (x=Time, y=Kilobits.sum, color=Type), size=1) +
+  ylab("Rate [Kbits/s]") +
+  facet_wrap(~ Node)
 
-print (g.all)
-  
+print(g.all)
+
 # graph rates on the root nodes in Packets
-g.root <- ggplot (data.root) +
-  geom_point (aes (x=Time, y=Kilobits.sum, color=Type), size=2) +
-  geom_line (aes (x=Time, y=Kilobits.sum, color=Type), size=0.5) +
-  ylab ("Rate [Kbits/s]")
+g.root <- ggplot(data.root) +
+  geom_point(aes (x=Time, y=Kilobits.sum, color=Type), size=2) +
+  geom_line(aes (x=Time, y=Kilobits.sum, color=Type), size=0.5) +
+  ylab("Rate [Kbits/s]")
 
-print (g.root)
+print(g.root)
 
-png ("root-rates.png", width=500, height=250)
-print (g.root)
-dev.off ()
-
-###############################
-# Aggreagate trace processing #
-###############################
-
-data = read.table ("aggregate-trace.txt", header=T)
-data$Node = factor (data$Node)
-data$FaceId <- factor(data$FaceId)
-data$Type = factor (data$Type)
-
-# exlude irrelevant types
-data = subset (data, Type %in% c("InInterests", "OutInterests", "InData", "OutData"))
-
-# Aggregate packet stats in 5-second intervals
-data$Time5Sec = 5 * ceiling (data$Time / 5)
-data.combined = summaryBy (. ~ Time5Sec + Node + Type, data=data, FUN=sum)
-
-data.root = subset (data.combined, Node == "root")
-data.leaves = subset (data.combined, Node %in% c("leaf-1", "leaf-2", "leaf-3", "leaf-4"))
-
-# graph rates on all nodes in Packets
-g.all <- ggplot (data.combined) +
-  geom_point (aes (x=Time5Sec, y=Packets.sum, color=Type), size=2) +
-  geom_line (aes (x=Time5Sec, y=Packets.sum, color=Type), size=0.5) +
-  ylab ("Number of transitted packets in 5 secon intervals") +
-  facet_wrap (~ Node)
-
-print (g.all)
-  
-# graph rates on the root nodes in Packets
-g.root <- ggplot (data.root) +
-  geom_point (aes (x=Time5Sec, y=Packets.sum, color=Type), size=2) +
-  geom_line (aes (x=Time5Sec, y=Packets.sum, color=Type), size=0.5) +
-  ylab ("Number of transitted packets in 5 secon intervals") +
-  ylim (c(0,2000))
-
-print (g.root)
-
-png ("root-5sec-counts.png", width=500, height=250)
-print (g.root)
-dev.off ()
+png("src/ndnSIM/docs/source/_static/root-rates.png", width=500, height=250)
+print(g.root)
+retval <- dev.off()