-
-
Save luxbock/99645147579aee4812ac9870efa9bb4a to your computer and use it in GitHub Desktop.
This file contains 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
(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