Resposta:
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)
res1.xleg <- "Time bewtween Things requests (seconds)"
res1.yleg <- "Response time"
res1.chart1.pch <- c(4, 11, 1, 2, 5, 4)
res1.chart1.col <- c("black", "yellow", "red", "blue", "purple", "green")
res1.chart1.legend <- c("1 Fog", "3 Fogs", "5 Fogs","10 Fogs","15 Fogs","w/o Fog")
plot(clock, MRT_1F, type="o", pch=res1.chart1.pch[1], xlab=paste(res1.xleg,"(seconds)"), ylab=paste(res1.yleg,"(sec.)"))
lines(clock, y=MRT_3F, type="o", col=res1.chart1.col[2], pch=res1.chart1.pch[2])
lines(clock, y=MRT_5F, type="o", col=res1.chart1.col[3], pch=res1.chart1.pch[3])
lines(clock, y=MRT_10F, type="o", col=res1.chart1.col[4], pch=res1.chart1.pch[4])
lines(clock, y=MRT_15F, type="o", col=res1.chart1.col[5], pch=res1.chart1.pch[5])
lines(clock, y=MRT_sem_F, type="o", col=res1.chart1.col[6], pch=res1.chart1.pch[6])
legend("topright", pch = res1.chart1.pch, col = res1.chart1.col, legend = res1.chart1.legend)
res1.general.col <- c("#E6E6E6", "#666666")
res1.general.xlab <- res1.xleg
res1.general.ylab <- paste(res1.yleg, "(s)")
par(mfrow=c(3, 2), mar= c(4, 4, 2, 0))
res1.chart2.legend=c("w/o Fog", "1 Fog")
barplot(matrix(c(rbind(MRT_sem_F, MRT_1F)), nrow=2, ncol=length(clock)), names.arg=clock, xlab=res1.general.xlab, ylab=res1.general.ylab, col=res1.general.col, beside=T, log="y")
legend("topright", fill=res1.general.col, legend=res1.chart2.legend)
res1.chart3.legend=c("w/o Fog", "3 Fogs")
barplot(matrix(c(rbind(MRT_sem_F, MRT_3F)), nrow=2, ncol=length(clock)), names.arg=clock, xlab=res1.general.xlab, ylab=res1.general.ylab, col=res1.general.col, beside=T, log="y")
legend("topright", fill=res1.general.col, legend=res1.chart3.legend)
res1.chart4.legend=c("w/o Fog", "5 Fogs")
barplot(matrix(c(rbind(MRT_sem_F, MRT_5F)), nrow=2, ncol=length(clock)), names.arg=clock, xlab=res1.general.xlab, ylab=res1.general.ylab, col=res1.general.col, beside=T, log="y")
legend("topright", fill=res1.general.col, legend=res1.chart4.legend)
res1.chart5.legend=c("w/o Fog", "10 Fogs")
barplot(matrix(c(rbind(MRT_sem_F, MRT_10F)), nrow=2, ncol=length(clock)), names.arg=clock, xlab=res1.general.xlab, ylab=res1.general.ylab, col=res1.general.col, beside=T, log="y")
legend("topright", fill=res1.general.col, legend=res1.chart5.legend)
res1.chart6.legend=c("w/o Fog", "15 Fogs")
barplot(matrix(c(rbind(MRT_sem_F, MRT_15F)), nrow=2, ncol=length(clock)), names.arg=clock, xlab=res1.general.xlab, ylab=res1.general.ylab, col=res1.general.col, beside=T, log="y")
legend("topright", fill=res1.general.col, legend=res1.chart6.legend)
Resposta:
res2.names <- c("$10-19", "$20-29", "$30-39", "$40-49")
res2.legend <- c("Good", "Very Good", "Excellent")
res2.good <- c(53.8, 33.9, 2.6, 0)
res2.veryGood <- c(43.6, 52.2, 60.5, 21.4)
res2.excellent <- c(2.6, 11.9, 36.8, 78.6)
res2.colors <- rainbow(3)
res2.data <- matrix(c(res2.good, res2.veryGood, res2.excellent), nrow=length(res2.legend), byrow=T)
par(mar = c(5, 4, 4, 2) + 0.1)
barplot(res2.data, names.arg=res2.names, main="Rating Quality by Meal Price", xlab="Meal Price", ylab="Quality Rating (%)", col= res2.colors)
legend("right", fill=res2.colors, legend=res2.legend, cex=0.8)
Resposta:
res3.airqualityData <- (filter(airquality, Month==5)$Temp-32)/1.8
hist(res3.airqualityData, col="gray", probability=T, main="Histograma da Temperatura de Maio", xlab="Temperatura (ºC)", ylab="Densidade")
lines(density(res3.airqualityData), col="black")
Resposta:
vendas <- read.table("https://training-course-material.com/images/8/8f/Sales.txt",header=TRUE)
res4.data <- vendas$SALES
res4.legend <- vendas$COUNTRY
res4.colors <- rainbow(length(res4.data))
pie(res4.data, labels=(paste(round(res4.data/sum(res4.data)*100), "%", sep="")), col=(res4.colors), main="Percentual de Vendas por País")
legend("right",legend=res4.legend, fill=res4.colors)
Resposta:
boxplot(count ~ spray, data=InsectSprays, main="Insetos por tipo de inseticida", col="yellow", outline=F, ylab="N.º de Insetos", xlab="Tipos de Inseticidas")