Skip to content

Instantly share code, notes, and snippets.

@ruseel
Created July 30, 2014 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruseel/ffc023bdb642aa02ad6f to your computer and use it in GitHub Desktop.
Save ruseel/ffc023bdb642aa02ad6f to your computer and use it in GitHub Desktop.
;; incanter
(use '(incanter core stats charts))
;; require clj-time to use f/parse
(alembic.still/distill '[clj-time])
(require '[clj-time.format :as f])
;; read dataset x.csv
(def r (read-dataset "x.csv" :header true))
;; timestamp to long
(def rr (with-data r (conj-cols $data ($map (fn [ts] (let [dt (f/parse ts)] (if dt (.getMillis dt) nil))) :lasttimestamp))))
;; view and save scatter-plot
(view (scatter-plot :col-0 :_c1 :data rr))
(save (scatter-plot :col-0 :_c1 :data rr) "x.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment