1.2.3-SNAPSHOT Arrow_down_16x16

get-categories

incanter.core

  • (get-categories cols data)

Given a dataset and one or more column keys, returns the set of categories for them.

Examples:

(use '(incanter core datasets))
(get-categories :eye (get-dataset :hair-eye-color))
(get-categories [:eye :hair] (get-dataset :hair-eye-color))


0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/core.clj:2038 top

(defn get-categories
"
  Given a dataset and one or more column keys, returns the set of categories for them.

  Examples:

    (use '(incanter core datasets))
    (get-categories :eye (get-dataset :hair-eye-color))
    (get-categories [:eye :hair] (get-dataset :hair-eye-color))


"
  ([cols data]
     (if (coll? cols)
       (for [col cols] (into #{} ($ col data)))
       (into #{} ($ cols data)))))
Vars in incanter.core/get-categories: coll? defn for into
Used in 0 other vars

Comments top

No comments for get-categories. Log in to add a comment.