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

Yohan Chalabi chalabi at phys.ethz.ch
Tue Oct 14 11:05:28 CEST 2008


>>>> "CGG" == "Christopher G. Green" <christopher.g.green at gmail.com>
>>>> on Sat, 11 Oct 2008 10:52:28 -0700

   CGG> Greetings,
   CGG> 
   CGG> Economagic.com has changed the format of the HTML representation of some of
   CGG> their data sets. It seems they have done this to break tools like
   CGG> economagicImport.
   CGG> 
   CGG> Consider the following (in R 2.7.2 with the current versions of fImport,
   CGG> etc.).
   CGG> 
   CGG> zzz <- economagicImport("fedny/day-fxus2eu", save=F, freq="daily")
   CGG> 
   CGG> > tail(zzz at data)
   CGG>            DATE  VALUE
   CGG> 2457 2008-10-03     NA
   CGG> 2458 2008-10-06     NA
   CGG> 2459 2008-10-07     NA
   CGG> 2460 2008-10-08     NA
   CGG> 2461 2008-10-09     NA
   CGG> 2462 2008-10-10 1.3471
   CGG> 
   CGG> If you go to the actual web site
   CGG> 
   CGG> http://www.economagic.com/em-cgi/data.exe/fedny/day-fxus2eu
   CGG> 
   CGG> and look at the source code you will see that they have inserted an entity
   CGG> representation "&#149;" for '.' in some places (and possibly more "white"
   CGG> characters). 
   CGG> 
   CGG> >From my five minutes of looking at the source code for economagicImport it
   CGG> seems like a well-placed 'gsub' to change all of the entities to periods
   CGG> would fix things (since then the conversion to numeric would work). I
   CGG> haven't had time to test that idea out, but hopefully I have given you
   CGG> enough detail to understand what's going on.
   CGG> 
   CGG> Chris Green
  
thanks Chris to point this out.

I have updated the function in the dev-package on r-forge.

regards,
Yohan

-- 
PhD student
Swiss Federal Institute of Technology
Zurich

www.ethz.ch



More information about the Rmetrics-core mailing list