forked from narenchoudhary/networks-assignment-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathque1_part2.R
More file actions
55 lines (51 loc) · 1.45 KB
/
que1_part2.R
File metadata and controls
55 lines (51 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
library(plyr)
library(dplyr)
library(magrittr)
library(ggplot2)
library(knitr)
nicru.o1 <- read.csv("Data/nicru20times_allsizes1.csv") %>%
select(time, packet_size, avg) %>%
group_by(packet_size) %>%
summarise(avg_summary = mean(avg))
nicru.o2 <- read.csv("Data/nicru20times_allsizes2.csv") %>%
select(time, packet_size, avg) %>%
group_by(packet_size) %>%
summarise(avg_summary = mean(avg))
nicru.o3 <- read.csv("Data/nicru20times_allsizes3.csv") %>%
select(time, packet_size, avg) %>%
group_by(packet_size) %>%
summarise(avg_summary = mean(avg))
nicru.o1$time <- 1
nicru.o2$time <- 2
nicru.o3$time <- 3
nicru.summary <- rbind(nicru.o1, nicru.o2, nicru.o3)
nicru.summary$time <- as.factor(nicru.summary$time)
nicru.summary$packet_size <- as.factor(nicru.summary$packet_size)
que1_part2plot <- ggplot(
nicru.summary,
aes(x = packet_size, y = avg_summary, group = time, color = time)
) +
geom_point() +
geom_line() +
labs(
title = "Variation of Packet Size with RTT\n of www.nic.ru",
x = "Packet Size(bytes)",
y = "Avg RTT (ms)"
) +
theme_bw() +
theme(
plot.title = element_text(size = rel(1.25)),
legend.position = "bottom",
legend.background = element_rect(
color = "black",
fill = "grey90",
size = 1,
linetype = "solid"
),
legend.direction = "horizontal"
) +
scale_color_manual(
"Time",
labels=c("11AM", "4PM", "12AM"),
values=as.factor(c("1", "2", "3"))
)