[R-br] RES: [R-brUso do laço for para impessão de mais de um arquivo gerado.

Éder Comunello comunello.eder em gmail.com
Segunda Março 16 21:27:46 BRT 2015


Boa noite,

Precisa tirar o argumento header=T que não é válido para write.table(). O
equivalente seria col.names=T que já é default.

Éder Comunello <c <comunello.eder em gmail.com>omunello.eder em gmail.com>
Dourados, MS - [22 16.5'S, 54 49'W]

Em 15 de março de 2015 19:43, Mauro Sznelwar <sznelwar em uol.com.br> escreveu:

>  Por que não estou conseguindo rodar?
>
>
>
> symbol<-c("XOM","AAPL", "DIS")
>
>
>
>  getCSV <- function(symbol){
>
> +   URL <- paste0("http://chartapi.finance.yahoo.com/instrument/1.0/",
> symbol, "/chartdata;type=quote;range=1d/csv")
>
> +   tab <- read.table(URL, sep = ",", dec = ".", skip = 17)
>
> +   colnames(tab) <-
> paste(c("timestamp","close","high","low","open","volume"), 1:6, sep = "-")
>
> +   rownames(tab) <- paste(symbol, 1:nrow(tab))
>
> +   SAIDA <- paste0("Dados",symbol,"yahoo20150312.txt")
>
> +   write.table(tab, file = SAIDA, sep = ";", dec = ".", header = T)
>
> + }
>
>
>
>  sapply(symbol, getCSV)
>
> Error in write.table(tab, file = SAIDA, sep = ";", dec = ".", header = T)
> :
>
>   unused argument (header = T)
>
>
>
>
>
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20150316/98de3629/attachment.html>


Mais detalhes sobre a lista de discussão R-br