0
votes

I'm sure this is super simple to understand, but I'm new to R, and try as I might, I can't get the other suggestions on these forums to work for me. I'm just trying to download the PAYEMS time series through the Quantmod package.

The code:

library(quantmod) 
library(lubridate) 

getSymbols("PAYEMS", src=("FRED"), return.class = "xts")

The output:

getSymbols("PAYEMS", src=("FRED"), return.class = "xts") Error in charToDate(x) : character string is not in a standard unambiguous format

I'm guessing it's the date format, but it's not clear to me how I fix that. I only know how to change it once I get the vector I want to make into dates.

Thanks!

1
Your code works fine for me. It's probably a dependency issue; from the quantmod DESCRIPTION file: Depends: xts(>= 0.9-0), zoo, TTR(>= 0.2), methods Suggests: DBI,RMySQL,RSQLite,timeSeries,its,XML,downloader - alistaire
Not sure I follow. I installed those packages to see if that would help. No dice. How would you recommend I go about fixing the problem. Thanks again. - huesecon
I can't reproduce the error, so I can only speculate. If everything is installed and up to date, you can try traceback() or debugging to see if you can find out what's causing the problem, but given the code works for me, it's probably some sort of configuration issue, not a code issue, so that approach may not give you an obvious answer. - alistaire
I had the same error when accidentally using a non-existing date such as "2017-06-31". A non-standard quote character could also be a reason for the error... - sdittmar

1 Answers

0
votes

I get this error occasionally too. I don't recall getting this the year before. Restarting R doesn't help, but restarting the computer does solve the problem. I don't know what it is that fixed this.