Gustavo Gustavo - 1 year ago 65
R Question

Error importing SDMX data into R

The problem happens when I am trying to import OECD data. For example, if I try the following code:

data.url <- ""
my.sdmx <- readSDMX(data.url)

I get the following error

<XMLInputError: XML content does not seem to be XML: '<message:MessageGroup xmlns="" ...

However, this only seems to happen with OECD data. If I replace
above with

data.url <- ""

then the code runs smoothly. It also works if I download the XML file and parse it using
readSDMX('file.xml', isURL=FALSE)

I wonder if this has anything to do with the '' characters that show up when parsing OECD XML, and if there is a way to fix this.

Answer Source

There has been some recent changes in OECD portal. One of them was that the web requests did not return a valid xml response. The few characters you mentioned correspond to the Bytes Order Mark (BOM). A control has been added very recently in rsdmx to manage properly such BOM, change that has also been reflected in CRAN. Upgrading to rsdmx 0.4-7 will solve your issue.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download