2
votes

The following code

  x <- getSymbols(Symbols="RU1000TR",
                  warnings=FALSE,
                  env=NULL,
                  src="FRED")

always seems to return a warning message such as:

Warning message:
In download.file(url, destfile, method, quiet, mode, cacheOK, extra) :
  downloaded length 189629 != reported length 200

(this happens for other symbols as well). This is an annoyance, as I cannot find a way to prevent the warning, but the actual data seems to be fine. try, tryCatch, and even sink(tmpfile, type="message") fail to catch/prevent the message as well. Since it's not fatal, is it something to live with?

2

2 Answers

1
votes

These warnings are thrown by download.file. They mean the remote file system reports a file of length 200, but a different size file was actually downloaded. They can be ignored.

You can wrap your getSybmols calls in suppressWarnings if you want to keep them from being printed to the console.

1
votes

From the warning:

 This message is shown once per session and may be disabled by setting 
 options("getSymbols.warning4.0"=FALSE). See ?getSymbols for more details.