<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Bom dia senhores!</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Estou fazendo uma ilustração animada para demonstrar que a média é influenciada por valores extremos com o seguinte código:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style:
normal;"><span>png(file='exemplos/med0%1d.png',width=500,height=250)<br>x1 <- list()<br>medias <- list()<br>for(i in 1:10){<br> x <- c(7,10,13.4,15.3,17.6,19.5,20.6,21.1)<br> y <- rep(0,8)<br> x1[[i]] <- c(x,i+21.1)<br> medias[[i]] <- mean(x1[[i]])<br> plot(x,y,ylim=c(0,5),xlim=c(0,35),ylab='',xlab='',axes=F) <br> axis(1)<br> par(xpd=TRUE)<br> points(mean(x),-0.2,col='blue',lwd=10,pch=2)<br> points(x1[[i]][9],0,col='red',lwd=7,cex=0.1)<br> points(medias[[i]],-0.2,col='blue',lwd=10,pch=2)<br>}<br>dev.off()<br><br>png(file='exemplos/med1%1d.png',width=500,height=250)<br>x2 <- list()<br>medias2 <- list()<br>for(j in seq(10,1,-1)){<br> x2[[j]] <- c(12.3-j,x)<br> medias2[[j]] <-
mean(x2[[j]])<br> plot(x,y,ylim=c(0,5),xlim=c(0,35),ylab='',xlab='',axes=F) <br> axis(1)<br> par(xpd=TRUE)<br> points(mean(x),-0.2,col='blue',lwd=10,pch=2)<br> points(x1[[j]][9],0,col='red',lwd=7,cex=0.1)<br> points(medias[[j]],-0.2,col='blue',lwd=10,pch=2)<br>}<br>dev.off()<br><br>png(file='exemplos/med2%1d.png',width=500,height=250)<br>for(j in 1:10){<br> x2[[j]] <- c(12.3-j,x)<br> medias2[[j]] <- mean(x2[[j]])<br> plot(x,y,ylim=c(0,5),xlim=c(0,35),ylab='',xlab='',axes=F) <br> axis(1)<br> par(xpd=TRUE)<br> points(mean(x),-0.2,col='blue',lwd=10,pch=2)<br> points(x2[[j]][1],0,col='red',lwd=7,cex=0.1)<br>
points(medias2[[j]],-0.2,col='blue',lwd=10,pch=2)<br>}<br>dev.off()<br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">É possível juntar isso em um único código?</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">Desde já grato por qualquer ajuda.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size:
16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">(S,f,P)</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">Allaman<br><span></span></div><div style="background-color:transparent;" align="center"><font style="background-color:transparent;" face="comic sans ms" size="2"><font size="1"><b><br></b></font></font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace, sans-serif" size="2">\begin{signature}</font></font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace, sans-serif" size="2"><<>>=</font></font></div><div style="text-align:left;background-color:transparent;"
align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Prof. Dr. Ivan Bezerra Allaman</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Universidade Estadual de Santa Cruz</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Departamento de Ciências Exatas e Tecnológicas</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Ilhéus/BA - Brasil</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Fone: +55 73 3680-5596</font></div><div
style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">E-mail: ivanalaman@yahoo.com.br/ivanalaman@gmail.com</font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace, sans-serif" size="2">@</font></font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace, sans-serif" size="2">\end{signature}</font></font></div></div></body></html>