I'm querying data from alphavantage using the getSymbols.av
function.
Whenever I run the standalone paragraph
GOOGL <- getSymbols.av("GOOGL",auto.assign=F,return.class = "xts",adjusted=T,outputs.size="full",data.type="csv",periodicity = "weekly")
GOOG <- getSymbols.av("GOOG",auto.assign=F,return.class = "xts",adjusted=T,outputs.size="full",data.type="csv",periodicity = "weekly")
google <- rbind.xts(GOOGL["2013-05-17/2014-04-04"],GOOG["2013-05-17/2018-05-18"])
google <- google[-48,]
it works. However, when I try to run the whole script in Source mode, i get this error:
Error in read.zoo(tmp, header = TRUE, sep = ",") :
index has bad entries at data rows: 1 2
In addition: Warning message:
In read(file, ...) :
incomplete final line found by readTableHeader on 'C:\Users\..\Temp
I opened that file and it is empty.
None of the other functions, who look exactly the same have this error. I tried to get wiser by studying this answer:'Incomplete final line' warning when trying to read a .csv file into R , but I didn't.
I'm a beginner at R, the code is meant to be sent to my Finance professor and I don't want to look like I'm struggling. I'd be very thankful for any help you could give.
My sessionInfo() is:
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252