12/18/2023 0 Comments Download www yahoo com finance![]() ![]() # convert date as character to date format #' try increasing the time for Sys.sleep(time = x) #' it's because the csv file has not completed downloading #' if you get: Error in file(file, "rt") : cannot open the connection YahooDF <- utils::read.csv(yahooCSV, header = TRUE) YahooCSV <- paste(DLdir, symbol, ".csv", sep = "") #' wait 500 msec for download to complete - mileage may vary #' DLdir defaults to download directory in browser preferences #' run the query - downloads the security as a csv file YahooURL <- paste(query1, query2, quer圓, sep = "") Quer圓 <- paste("&interval=", interval, "&events=history&crumb=", crumb, sep = "") ![]() Interval <- switch(period, daily = "1d", weekly = "1wk", monthly = "1mo") Query2 <- paste("period1=", fromPosix, "&period2=", toPosix, sep = "") <- function (symbol,įromPosix <- as.numeric(as.POSIXlt(from)) Superfluous as it now may be, I coded a fix that shows one approach to get around the download problem. ![]() Fortunately, help is on the way courtesy Joshua Ulrich. I've always wondered why Yahoo was so nice as to provide data downloads and how screwed I would be if they stopped doing it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |