MRT_1F <-c(517.1468515630205, 85.13094142168089, 30.333207896694553, 12.694776264558937, 3.3041601673945418, 1.1823111717498882, 1.1892293502386786)
MRT_3F <-c(156.68929936163462, 11.540837783562276, 0.4512835621696538, 0.4509797929766453, 0.4502068233039181, 0.4496185276300172, 0.4543157082191288)
MRT_5F <-c(83.90319666471157, 0.3068151086494968, 0.30522314133037304, 0.3072588968084928, 0.30655265997285697, 0.3055812715727718, 0.3053297166713006)
MRT_10F <-c(29.55430642951759, 0.19832832665772515, 0.1971923924717474, 0.19796648905716516, 0.19615594370806338, 0.2034569237883263, 0.19617420889447737)
MRT_15F <-c(11.317736530583566, 0.167364215666193, 0.16172168266811013, 0.16701085329580515, 0.1598052657153692, 0.1645934043532696, 0.16216563797118075)
MRT_sem_F <-c(11.93430909937736, 0.6095414637034009, 0.6060645101029295, 0.612167181646899, 0.6146761002685637, 0.6096747087200697, 0.6125810476877268)
clock <- c(0.1, 0.5, 1, 1.5, 2, 2.5, 3)
y_lims <- c(0, max(MRT_1F))
plot(x = clock, y = MRT_1F,
col = "black",
type = "o",
pch = 4,
ylim = y_lims,
xlab = "Time between Things requests (seconds)",
ylab = "Response Time (sec.)")
lines(x = clock, y = MRT_3F, type = "o", pch = 11, col ="yellow")
lines(x = clock, y = MRT_5F, type = "o", pch = 1, col ="red")
lines(x = clock, y = MRT_10F, type = "o", pch = 2, col ="blue")
lines(x = clock, y = MRT_15F, type = "o", pch = 5, col ="purple")
lines(x = clock, y = MRT_sem_F, type = "o", pch = 4, col ="green")
legend("topright",
pch = c(4, 11, 1, 2 ,5, 4),
col = c("black", "yellow", "red", "blue", "purple", "green"),
legend = c("1 Fog", "3 Fog", "5 Fog", "10 Fog", "15 Fog", "w/o Fog"),
lty = 1
)
par(mfrow = c(3,2))
# 1F
aux <- rbind(MRT_sem_F, MRT_1F)
barplot(aux,
ylab = "Response Time(sec.)",
xlab = "Time between Things requests (seconds)",
log = "y",
col = c("#E6E6E6", "#666666"),
beside = T,
names.arg = clock)
legend("topright",
legend = c("w/o Fog", "1 Fog"),
pch = c(15, 15),
col = c("#E6E6E6", "#666666"))
# 3F
aux <- rbind(MRT_sem_F, MRT_3F)
barplot(aux,
ylab = "Response Time(sec.)",
xlab = "Time between Things requests (seconds)",
log = "y",
col = c("#E6E6E6", "#666666"),
beside = T,
names.arg = clock)
legend("topright",
legend = c("w/o Fog", "3 Fog"),
pch = c(15, 15),
col = c("#E6E6E6", "#666666"))
# 5F
aux <- rbind(MRT_sem_F, MRT_5F)
barplot(aux,
ylab = "Response Time(sec.)",
xlab = "Time between Things requests (seconds)",
log = "y",
col = c("#E6E6E6", "#666666"),
beside = T,
names.arg = clock)
legend("topright",
legend = c("w/o Fog", "5 Fog"),
pch = c(15, 15),
col = c("#E6E6E6", "#666666"))
# 10F
aux <- rbind(MRT_sem_F, MRT_10F)
barplot(aux,
ylab = "Response Time(sec.)",
xlab = "Time between Things requests (seconds)",
log = "y",
col = c("#E6E6E6", "#666666"),
beside = T,
names.arg = clock)
legend("topright",
legend = c("w/o Fog", "10 Fog"),
pch = c(15, 15),
col = c("#E6E6E6", "#666666"))
# 15F
aux <- rbind(MRT_sem_F, MRT_15F)
barplot(aux,
ylab = "Response Time(sec.)",
xlab = "Time between Things requests (seconds)",
log = "y",
col = c("#E6E6E6", "#666666"),
beside = T,
names.arg = clock)
legend("topright",
legend = c("w/o Fog", "15 Fog"),
pch = c(15, 15),
col = c("#E6E6E6", "#666666"))
Good <- c(53.8, 33.9, 2.6, 0.0)
Very_Good <- c(43.6, 54.2, 60.5, 21.4)
Excellent <- c( 2.6, 11.9, 36.8, 78.6)
aux <- rbind(Good, Very_Good, Excellent)
colnames(aux) <- c("$10–19", "$20–29", "$30–39", "$40–49")
barplot(
aux,
col = c("white", "gray", "black"),
main = "Qualidade da Refeição por Categoria de Preço",
xlab = "Meal price",
ylab = "Percentage (%)",
ylim = c(0, 120)
)
legend(
"topright",
legend = c("Good", "Very Good", "Excellent"),
fill = c("white", "gray","black"),
title = "Quality Rating",
bg = "white"
)
dataset <- airquality
dataset$celsius <- (dataset$Temp - 32) / 1.8
hist(dataset$celsius,
col="gray",
main="Histograma da temperatura",
ylab="Frequencia",
xlab="Temperatura",
probability = T)
lines(density(dataset$celsius))
sales <- read.table("https://www.dropbox.com/scl/fi/mpjt4uuqb5vtmfiw38phk/Sales.txt?rlkey=93jlz79xwrrt7ah66d5k403d7&dl=1", header = TRUE)
cores <- c("blue", "orange", "green", "violet", "purple", "brown")
porcentagem <- round((sales$SALES) / sum(sales$SALES) * 100, 1)
nomes <- paste0(porcentagem, "%")
pie(x = sales$SALES, labels = nomes, col = cores, main = "Porcentagem de vendas total dos paises.")
legend("topright",
legend = sales$COUNTRY,
fill = cores,
title = "Paises")
dataset <- InsectSprays
boxplot(count ~ spray,
data = dataset,
outline = F,
main = "Eficacia de inseticidas",
xlab = "Numero de sprays",
ylab = "Quantidade de praga",
col = "yellow")
library(readr)
converterMemoria <- function(vetor){
valor <- as.numeric(gsub("[^0-9.]", "", vetor))
unidade <- trimws(gsub("[0-9.]", "", vetor))
mb <- ifelse(grepl("TB", unidade, ignore.case = TRUE), valor * 1000000,
ifelse(grepl("GB", unidade, ignore.case = TRUE), valor * 1024,
ifelse(grepl("KB", unidade, ignore.case = TRUE), valor / 1024,
valor)))
return(mb)
}
preparacao <- function(caminho){
df <- read.csv(caminho, stringsAsFactors = FALSE)
tempo <- as.POSIXct(df$currentTime)
df$tempo_horas <- as.numeric(difftime(tempo, tempo[1], units = "hours"))
df$memoria_mb <- converterMemoria(df$usedMemory)
return(df)
}
dataset_none <- preparacao("monitoringCloudData_NONE.csv")
dataset_01 <- preparacao("monitoringCloudData_0.1.csv")
dataset_05 <- preparacao("monitoringCloudData_0.5.csv")
dataset_1 <- preparacao("monitoringCloudData_1.csv")
layout(matrix(c(1, 2, 3, 4), nrow = 2, ncol = 2, byrow = TRUE))
par(mar = c(4.5, 4.5, 3, 2))
plot(
x = dataset_none$tempo_horas,
y = dataset_none$memoria_mb,
type = "l",
main = "Memory Analysis (None Workload)",
xlab = "Time (hour)",
ylab = "Used Memory (MB)"
)
plot(
x = dataset_01$tempo_horas,
y = dataset_01$memoria_mb,
type = "l",
main = "Memory Analysis (Workload of 0.1)",
xlab = "Time (hour)",
ylab = "Used Memory (MB)"
)
plot(
x = dataset_05$tempo_horas,
y = dataset_05$memoria_mb,
type = "l",
main = "Memory Analysis (Workload of 0.5)",
xlab = "Time (hour)",
ylab = "Used Memory (MB)"
)
plot(
x = dataset_1$tempo_horas,
y = dataset_1$memoria_mb,
type = "l",
main = "Memory Analysis (Workload of 1.0)",
xlab = "Time (hour)",
ylab = "Used Memory (MB)"
)
library(plotly)
library(dplyr)
dataset <- read_csv("netflix_titles.csv")
dados_um_pais <- dataset %>%
filter(!is.na(country) & country != "" & !grepl(",", country))
top10_paises <- dados_um_pais %>%
count(country, name = "total", sort = TRUE) %>%
head(10)
fig <- plot_ly(
data = top10_paises,
labels = ~country,
values = ~total,
type = "pie",
textinfo = "label+percent"
) %>%
layout(
title = "Top 10 Países com Mais Conteúdo (Apenas 1 País de Origem)"
)
fig
plot_ly(
data = top10_paises,
type = "table",
header = list(
values = c("<b>País</b>", "<b>Total de conteúdos</b>"),
align = "center",
fill = list(color = "gray"),
font = list(family = "Arial", size = 14, color = "white"),
line = list(width = 1.5, color = "black")
),
cells = list(
values = rbind(top10_paises$country, top10_paises$total),
align = "center",
font = list(family = "Arial", size = 12, color = "black"),
line = list(width = 1.5, color = "black")
)
)
library(plotly)
library(dplyr)
library(readr)
dataset <- read_csv("netflix_titles.csv", show_col_types = FALSE)
# Filtro pela data
dados_decada <- dataset %>%
filter(!is.na(release_year)) %>%
mutate(decada = (release_year %/% 10) * 10) %>%
count(decada, type, name = "total")
fig <- plot_ly() %>%
add_trace(
data = dados_decada %>% filter(type == "TV Show"),
x = ~decada,
y = ~total,
name = "TV Series",
type = "scatter",
mode = "lines+markers",
line = list(color = "blue"),
marker = list(color = "blue")
) %>%
add_trace(
data = dados_decada %>% filter(type == "Movie"),
x = ~decada,
y = ~total,
name = "Movies",
type = "scatter",
mode = "lines+markers",
line = list(color = "#FFC107"),
marker = list(color = "#FFC107")
) %>%
layout(
xaxis = list(title = "Década"),
yaxis = list(title = "Qtd. Conteúdo")
)
fig
library(plotly)
library(dplyr)
library(readr)
dataset <- read_csv("netflix_titles.csv", show_col_types = FALSE)
dados_filmes <- dataset %>%
filter(type == "Movie") %>%
mutate(genero = trimws(sub(",.*", "", listed_in))) %>%
filter(release_year > 2000 & release_year < 2010) %>%
filter(genero %in% c("Dramas", "Action & Adventure", "Comedies")) %>%
count(release_year, genero, name = "total")
fig <- plot_ly(
data = dados_filmes,
x = ~release_year,
y = ~total,
color = ~genero,
type = "bar"
) %>%
layout(
barmode = "group",
xaxis = list(title = "Ano de Lançamento", tickmode = "linear", dtick = 2),
yaxis = list(title = "Qnt. de Lançamentos"),
legend = list(title = list(text = ""))
)
fig