** complex
:PROPERTIES:
:DATE: 2010-06-28
:END:
#+name: raw-data
#+begin_src sh :results scalar
wget --quiet -qO- "http://ogdi.cloudapp.net/v1/dc/RecreationParks?format=json"
#+end_src
#+name: dc-parks
#+begin_src emacs-lisp :var keys='(ward area) :var data=raw-data
(mapcar
(lambda (lis) (mapcar (lambda (key) (cdr (assoc key lis))) keys))
(cdr (car (with-temp-buffer
(insert data) (goto-char (point-min))
(json-read)))))
#+end_src
#+name: dc-parks-metric
#+begin_src ruby :var data=dc-parks
data.map{|f| [f[0], 2.59 * f[1]]}
#+end_src
#+begin_src R :var parkData=dc-parks-metric :file parks.png :session *R*
plot(parkData)
title(main="Park size by Ward")
#+end_src
#+name:
[[file:parks.png]]