economagicImport no longer working correctly due to change in economagic.com's data format

Christopher G. Green christopher.g.green at gmail.com
Sat Oct 11 19:52:28 CEST 2008


Greetings,

Economagic.com has changed the format of the HTML representation of some of
their data sets. It seems they have done this to break tools like
economagicImport.

Consider the following (in R 2.7.2 with the current versions of fImport,
etc.).

zzz <- economagicImport("fedny/day-fxus2eu", save=F, freq="daily")

> tail(zzz at data)
           DATE  VALUE
2457 2008-10-03     NA
2458 2008-10-06     NA
2459 2008-10-07     NA
2460 2008-10-08     NA
2461 2008-10-09     NA
2462 2008-10-10 1.3471

If you go to the actual web site

http://www.economagic.com/em-cgi/data.exe/fedny/day-fxus2eu

and look at the source code you will see that they have inserted an entity
representation "&#149;" for '.' in some places (and possibly more "white"
characters). 

>From my five minutes of looking at the source code for economagicImport it
seems like a well-placed 'gsub' to change all of the entities to periods
would fix things (since then the conversion to numeric would work). I
haven't had time to test that idea out, but hopefully I have given you
enough detail to understand what's going on.

Chris Green
________________________________

Christopher G. Green (cggreen AT stat.washington.edu), 
Doctoral Candidate,
Department of Statistics, Box 354322, Seattle, WA, 98195-4322, U.S.A.
http://www.stat.washington.edu/people/cggreen/



More information about the Rmetrics-core mailing list