1

I am struggling with using readSDMX into a dataframe. My code is below, along with the error. Any help on this would be greatly appreciated. This is my first time using the RSDMX library, so pretty new to this.Thanks in advance!

tmp <- tempfile()
download.file("https://markets.newyorkfed.org/api/ambs/all/results/summary/search.sdmx.xml? 
               startdate=03/01/2020&enddate=04/05/2020", tmp) 


fedops <- readSDMX(tmp,isURL = FALSE)
fedops2 <- as.data.frame(fedops)

Error in t.default(attrs) : argument is not a matrix

  • I can't get your url working `status was 'URL using bad/illegal format or missing URL'`. – Chris Apr 09 '20 at 07:23
  • hmm. interesting it works for me, but what if you try this one? https://markets.newyorkfed.org/api/ambs/all/results/details/lastTwenty.sdmx.xml – akennedy12345 Apr 09 '20 at 13:42
  • actually.. i just tried using the above link and my above code worked! the previous url was from this search criteria page, where you put in the dates, and then off to the right a xml link pops up and that is where i grabbed the URL. https://www.newyorkfed.org/markets/ambs/operations/search – akennedy12345 Apr 09 '20 at 13:46
  • From your first comment worked, and I'll grab from your second so we're working on same data, but when you `str(fedops)` do you see any `slots` with matrices? As I see it, we have an S4 object as result of readSMDX which doesn't need further massaging to data.frame. Ok, have to walk dogs. Back in a bit. – Chris Apr 09 '20 at 14:02
  • Hey chris. i really appreciate your help on this. i do not see any matrices when i str(fedops) unfortunatly. im trying to compare this to the str() on the url that does work. not really seeing any differences so far. – akennedy12345 Apr 09 '20 at 14:37
  • [rsdmx_quickstart](https://cran.r-project.org/web/packages/rsdmx/vignettes/quickstart.html) near the bottom, we see `rsdmx is implemented in object-oriented way with S4 classes and methods. The properties of S4 objects are named slots and can be accessed with the slot method.` I'd suggest getting a familiarity with the SDMX stuff via OECD data rather than Fed Reserve for the moment as it appears more adopted in the OECD context, while Fed seems more provisional. Americans love their spread sheets? Then with an instinct of what you should be able to accomplish, explore the FED. – Chris Apr 09 '20 at 14:54

0 Answers0