This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use '(incanter core charts excel)) | |
;; read .xls file of Australian airline passenger data from the 1950s. | |
(with-data (read-xls "http://incanter.org/data/aus-airline-passengers.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))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
-- needed for creating [Char] instances | |
{-# LANGUAGE FlexibleInstances #-} | |
-- Use the following to allow records to have name field names. | |
-- {-# LANGUAGE DuplicateRecordFields #-} | |
module Lib |
OlderNewer