Skip to content

Instantly share code, notes, and snippets.

@ithayer
Created February 13, 2013 19:59
Show Gist options
  • Save ithayer/4947661 to your computer and use it in GitHub Desktop.
Save ithayer/4947661 to your computer and use it in GitHub Desktop.
;; All the visitors to my site.
#> (->> (all-visitors) count)
1000
;; Which browsers?
#> (->> (all-visitors) (map :browser) frequencies)
{:ie-10 50 :ie-9 250 :ie-8 200 :firefox 140 :chrome 360}
;; Average spend?
#> (let [spent (->> (all-visitors) (keep :spend))]
(/ (reduce + spent) (count spent)))
123.12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment