<div dir="ltr">A diferença se deve que o arquivo muda com o passar do tempo (diria que a cada 5 minutos, mas é apenas um chute). E para esse caso eu usaria read.csv com os parâmetros <b>skip = 17</b> para ignorar as 17 primeiras linhas e <b>header = FALSE</b>, já que a tabela nao possui cabeçalho.<div><br></div><div>read.csv('<a href="http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv">http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv</a>', skip = 17, header = FALSE)<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-24 14:40 GMT-03:00 Michelle Bau Graczyk <span dir="ltr"><<a href="mailto:mbgraczyk@gmail.com" target="_blank">mbgraczyk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Boa tarde,<div><br></div><div>Eu estava verificando os diferentes modos de coletar dados intraday do yahoo e percebi que para cada função que eu uso, os dados obtidos são diferentes.</div><div><br></div><div>Por exemplo, se eu uso:</div><div><br></div><div>dados <- readLines('<a href="http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv" target="_blank">http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv</a>',sep = ",", dec = ".")<br></div><div><br></div><div>eu obtenho:</div><div><div>"18" "1427203800,127.1800,127.2600,127.0000,127.2300,631900"</div><div>"19" "1427203868,126.9200,127.1900,126.8750,127.1700,202000"</div><div>"20" "1427203920,126.9600,127.0600,126.8700,126.9100,189500"</div><div>"21" "1427203981,126.9500,126.9900,126.8800,126.8900,198200"</div><div>"22" "1427204099,126.7799,126.9900,126.7700,126.9500,217500"</div><div>"23" "1427204100,126.6700,126.9000,126.6401,126.7799,286300"</div><div>"24" "1427204219,126.7100,126.8000,126.6500,126.6800,222800"</div><div>"25" "1427204221,126.8300,126.8700,126.5600,126.7000,238500"</div><div>"26" "1427204280,126.7100,126.9200,126.6700,126.8200,167500"</div><div>"27" "1427204340,126.8300,126.9300,126.7000,126.7166,114900"</div><div>"28" "1427204457,126.6400,126.8300,126.6000,126.8100,156100"</div><div>"29" "1427204460,126.6500,126.7900,126.6385,126.6900,102800"</div></div><div><br></div><div>se eu uso:</div><div>dados <- getURL('<a href="http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv" target="_blank">http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv</a>',sep = ",", dec = ".")<br></div><div>obtenho:</div><div><br></div><div><div>1427203805,127.1900,127.2600,127.0796,127.2000,626100</div><div>1427203862,126.9200,127.1900,126.8750,127.1800,207800</div><div>1427203979,126.9000,127.0600,126.8700,126.9100,198000</div><div>1427203980,126.9500,126.9900,126.8800,126.9000,172200</div><div>1427204099,126.7799,126.9900,126.7700,126.9500,235000</div><div>1427204100,126.6700,126.9000,126.6401,126.7799,286300</div><div>1427204219,126.7100,126.8000,126.6500,126.6800,222800</div><div>1427204221,126.8300,126.8700,126.5600,126.7000,238500</div><div>1427204280,126.7100,126.9200,126.6700,126.8200,167500</div><div>1427204340,126.8300,126.9300,126.7000,126.7166,114900</div><div>1427204459,126.6915,126.8300,126.6100,126.8100,160900</div><div>1427204460,126.6500,126.7900,126.6385,126.6900,98000</div></div><div><br></div><div>Usando read.csv também dá dados diferentes de começo.</div><div><br></div><div>Alguem saberia me dizer o por que? E em qual devo confiar? Porque nenhuma é igualzinha ao que aparece quando você coloca esse endereço <a href="http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv" target="_blank">http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv</a> no navegador. O resultado deste é:</div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">1427203800,127.1200,127.2300,127.0000,127.2300,631900
1427203900,127.0300,127.1900,127.0000,127.1700,87400
1427203978,126.9200,127.0400,126.8700,126.9050,309600
1427204038,126.9600,126.9900,126.8800,126.9399,174900
1427204099,126.7799,126.9900,126.7700,126.9600,235300
1427204100,126.6700,126.9000,126.6401,126.7799,286300
1427204219,126.7100,126.8000,126.6500,126.6800,222800
1427204221,126.8300,126.8700,126.5600,126.7000,238500
1427204280,126.7100,126.9200,126.6700,126.8200,167500
1427204340,126.8300,126.9300,126.7000,126.7166,114900
1427204459,126.6915,126.8300,126.6000,126.8100,160900
1427204460,126.6500,126.7900,126.6385,126.6900,98000
1427204520,126.7100,126.7200,126.6000,126.6500,108700
1427204581,126.7100,126.8400,126.6800,126.7100,129600
1427204641,126.7400,126.7700,126.6600,126.7300,98700</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">Obrigada,</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">Michelle</pre></div><div><br></div></div>
<br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br></div>