Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2010 23:53
What would you like to do?
(use '(incanter core charts excel))
;; read .xls file of Australian airline passenger data from the 1950s.
(with-data (read-xls "")
(view $data)
;; time-series-plot needs time in millisecs
;; create a function, to-millis, to convert a sequence of Date objects
;; to a sequence of milliseconds
(let [to-millis (fn [dates] (map #(.getTime %) dates))]
(view (time-series-plot (to-millis ($ :date)) ($ :passengers)))))
;; save one of the built-in sample datasets as an xls file.
(use '(incanter core datasets excel))
(save-xls (get-dataset :cars) "/tmp/cars.xls")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment