当前位置: 动力学知识库 > 问答 > 编程问答 >

csv - R - reported length 200

问题描述:

I am a student in finance from France and a newbie in statistical computing. My teacher gave me a project to do in asset management. I have to use R(version 3.2.3) in order to import files from Yahoo Finance.

I have installed the Tseries package and I realised that I cannot report the entire database. This is what I wrote :

accor <- get.hist.quote(instrument = "AC.PA", start = "2009-01-01",

end="2015-07-27", compression="w", quote="Close")

And it is currently written :

accor <- get.hist.quote(instrument = "AC.PA", start = "2009-01-01",

end="2015-07-27", compression="w", quote="Close")

essai de l'URL 'http://chart.yahoo.com/table.csv?s=AC.PA&a=0&b=01&c=2009&d=6&e=27&f=2015&g=w&q=q&y=0&z=AC.PA&x=.csv'

Content type 'text/csv' length 200 bytes

downloaded 17 KB

Warning message:

In download.file(url, destfile, method = method, quiet = quiet) :

downloaded length 18358 != reported length 200

I used exactly the same line at my school and it worked. The only difference is that it was on a Windows 7 computer.

I would like the whole downloaded length to be reported in order to make a decent analysis.

Sorry for my English. I hope it is understandable.

I would be grateful if someone could help me.

Thanks in advance.

网友答案:

It is only a warning, not an error. But if you question was "how to avoid a warning" then this could help on some platforms (particularly on "windows 7 x64") to avoid a warning caused by internal call to 'download.file()' function.

options(download.file.method='libcurl')

You need to set 'download.file.method' option to 'libcurl' before the actual call of get.hist.quote or similar method.

分享给朋友:
您可能感兴趣的文章:
随机阅读: