Skip to content

New data source - now how do we build an R interface?

2 messages · Ajay Shah, Gabor Grothendieck

#
Folks,

A nice new data resource has come up -- http://data.un.org/
I thought it would be wonderful to setup an R function like
tseries::get.hist.quote() which would be able to pull in some or all
of this data.

I walked around a bit of it and I'm not able to map the resources to
predictable URLs which can then be wget. There's some javascript going
on that I'm not understanding. Perhaps someone on the mailing list can
think about this?
#
Try to download something in IE and look at the bottom of your browser
where the URL is displayed or look at the Javascript in:
http://data.un.org/_Scripts/SeriesActions.js

and its apparent that the format is as follows:
http://data.un.org/Handlers/DownloadHandler.ashx?DataFilter=srID:1000&dataMartId=CDB&&Format=csv&c=2,3,4

It also accepts Format=xml, scsv (semicolon separated) and psv (pipe separated)
formats and there is a sort field (s=...) allowed which I omitted
since it appears
to work without it.  You will have to experiment to find the possible
values of the
other fields.

The result of entering the above URL in your browser is to download a zip
file containing the indicated data in csv format.
On Wed, Mar 5, 2008 at 1:16 PM, Ajay Shah <ajayshah at mayin.org> wrote: