<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Jackson,<br><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Excelente. Com suas dicas eu consegui tirar os dados que eu precisava. Abaixo segue um CMR, para quem se sentir curioso, que lê as tabelas por meio da url correspondente aos dias da maratona e no final calcula algumas estatísticas canditadas à relacionar com o desempenho dos atletas.<br>
<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Grato.<br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Walmes.<br><br><span style="font-family:courier new,monospace">#-----------------------------------------------------------------------------<br>
# Lê tabelas de clima nos dias da maratona de Paris.<br><br>ini <- "<a href="http://www.wunderground.com/history/airport/LFPB/">http://www.wunderground.com/history/airport/LFPB/</a>"<br>fim <- "/DailyHistory.html??format=1&format=1"<br>
dia <- c("2012/10/14")<br><br># padrão do endereço das tabelas<br>url <- paste(ini, dia, fim, sep="")<br><br>da <- read.table(url, sep=",", header=TRUE,<br> na.string=c("N/A","-","","-9999"))<br>
str(da)<br><br>#----------------------------------------------------------------------------<br>## Datas do evento.<br><br>## <a href="http://www.20kmparis.com/web/affiches.asp">http://www.20kmparis.com/web/affiches.asp</a><br>
<br>dias <- c("2012/10/14","2011/10/9","2010/10/10",<br> "2009/10/11","2008/10/12","2007/10/17",<br> "2006/10/15","2005/10/16","2004/10/17")<br>
<br>lercada <- function(dia){<br> ini <- "<a href="http://www.wunderground.com/history/airport/LFPB/">http://www.wunderground.com/history/airport/LFPB/</a>"<br> fim <- "/DailyHistory.html??format=1&format=1"<br>
url <- paste(ini, dia, fim, sep="")<br> da <- read.table(url, sep=",", header=TRUE,<br> na.string=c("N/A","-","","-9999"))<br> cat(dia, "\t ok!\n")<br>
return(da)<br>}<br><br>L <- lapply(dias, lercada)<br>sapply(L, class)<br>sapply(L, dim)<br>sapply(L, names)<br><br>names(L) <- 2012:2004<br><br>#-----------------------------------------------------------------------------<br>
<br>require(plyr)<br><br>M <- ldply(L)<br>str(M)<br>names(M)[1] <- "ano"<br><br>aggregate(cbind(TemperatureC,Humidity)~ano, data=M, max)<br>aggregate(cbind(TemperatureC,Humidity)~ano, data=M, mean)<br>aggregate(cbind(TemperatureC,Humidity)~ano, data=M, median)<br>
<br>#-----------------------------------------------------------------------------<br></span></div><div class="gmail_default"></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Walmes Marques Zeviani</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">fone: (+55) 41 3361 3573</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">skype: walmeszeviani<br style="font-family:trebuchet ms,sans-serif"></span><span style="font-family:trebuchet ms,sans-serif">homepage: <a href="http://www.leg.ufpr.br/%7Ewalmes" target="_blank">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">linux user number: 531218</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span><br>
</div></div><br></div></div>