Error in file(file, "rt") : cannot open the connection

How do I solve this problem that I present with the FinCal Package:

get.ohlc.yahoo(symbol="AAPL",start="2013-07-01",end="2013-08-01",freq="w")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  InternetOpenUrl failed: 'The server name or address could not be resolved'

And I'm browsing Google without problems, in fact I managed to enter the Forum

FinCal package hasn't been updated several years ago so there is a good chance that the underlying APIs have changed and the package is not going to work anymore, I would recommend you to use a different package like quantmod

library(quantmod)
getSymbols("AAPL", from="2013-07-01", to="2013-08-01", src =  "yahoo")
1 Like

[quote="andresrcs, post:2, topic:54028"]
like quantmod
I get the following alert
` ``
###examole
dat <-getSymbols("AAPL", from="2013-07-01", to="2013-08-01", src = "yahoo")
Warning message:
'indexClass<-' is deprecated.
Use 'tclass<-' instead.
See help("Deprecated") and help("xts-deprecated").
######example 2
getSymbols("AAPL")
[1] "AAPL"
Warning message:
'indexClass<-' is deprecated.
Use 'tclass<-' instead.
See help("Deprecated") and help("xts-deprecated").
##########example3

start_date <- as.Date("2017-01-02")
end_date <- as.Date("2018-02-09")
getSymbols("NYA", src = "yahoo", from = start_date, to = end_date)
[1] "NYA"
Warning message:
'indexClass<-' is deprecated.
Use 'tclass<-' instead.
See help("Deprecated") and help("xts-deprecated").

I think you can safely ignore this warning message for now, but be aware that if quantmod maintainers do not update their package to meet changes on xts this could also stop working in a near future.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.