Skip to content

Instantly share code, notes, and snippets.

@luxbock
Created June 23, 2016 16:20
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 luxbock/99645147579aee4812ac9870efa9bb4a to your computer and use it in GitHub Desktop.
Save luxbock/99645147579aee4812ac9870efa9bb4a to your computer and use it in GitHub Desktop.
(defn round-frequencies
[iso-map]
(transform [MAP-VALS
(transformed
[ALL (view iso-size)]
round-by-quarter)
(view (partial filter #(< % 7)))
(view frequencies)
(transformed
[(subselect MAP-VALS)
(collect-one (view #(apply + %)))
ALL]
(fn [total v] (/ v total)))]
#(into (sorted-map)
(keep (fn [[k v]]
(when (> v 1/100)
[k (-> 100
(* (double v))
str
(str/split #"\.")
first)])))
%)
iso-map))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment