[ndnSIM] How to display the total value
Yowaraj Chhetri
yowarj at gmail.com
Sat Nov 23 04:26:39 PST 2013
Dear all,
I am new to R and ggplot2 to display data acquired from ndnSim, When I run
the flowing code, it displays HopCount 4 and 2 at time 10sec respectively
and 4 and 4 in time 11sec. But I want to have it display as 6 (sum of
HopCount) in time 10sec and similarly sum of HopCount 8 for 11sec...and so
on. How to do that, Please help me.
app-delays-trace.txt
Time Node AppId SeqNo Type HopCount
10.0057 leaf-1 1 0 LastDelay 4
10.0057 leaf-1 1 0 FullDelay 4
10.0066 leaf-1 1 1 LastDelay 2
10.0066 leaf-1 1 1 FullDelay 2
11.0029 leaf-2 2 0 LastDelay 2
11.0029 leaf-2 2 0 FullDelay 2
11.0057 leaf-1 1 0 LastDelay 4
11.0057 leaf-1 1 0 FullDelay 4
11.0057 leaf-1 1 0 LastDelay 4
11.0057 leaf-1 1 0 FullDelay 4
My original code is
data = read.table ("app-delays-trace.txt", header=T)
data$Node = factor (data$Node)
data$AppId <- factor(data$AppId)
data$HopCount <- data$HopCount
data$Type = factor (data$Type)
# exlude irrelevant types
data = subset (data, Type %in% c("FullDelay"))
data = subset (data, Node %in% c("leaf-1"))
data = subset (data, AppId %in% c("1"))
# combine stats from all faces
data.combined = summaryBy (. ~ Time + Node + AppId + Type, data=data,
FUN=sum)
g.root <- ggplot (data.combined) +
geom_point (aes (x=Time, y=HopCount.sum, color=Type), size=0.5) +
geom_line (aes (x=Time, y=HopCount.sum, color=Type), size=0.5) +
ylab ("Hop Count")
print (g.root)
png ("app-delay-1.png", width=500, height=250)
print (g.root)
dev.off ()
With kind regards,
Yowaraj Chhetri
Japan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20131123/748aed75/attachment.html>
More information about the ndnSIM
mailing list