1.2.3-SNAPSHOT Arrow_down_16x16

dataset

incanter.core

  • (dataset column-names & data)
Returns a map of type incanter.core.dataset constructed from the given column-names and
data. The data is either a sequence of sequences or a sequence of hash-maps.

1 Example top

  • (dataset ["x1" "x2" "x3"]
             [[1 2 3]
              [4 5 6]
              [7 8 9]])
    
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:1146 top

(defn dataset
" Returns a map of type incanter.core.dataset constructed from the given column-names and
  data. The data is either a sequence of sequences or a sequence of hash-maps.
"
  ([column-names & data]
    (let [dat (cond
                   (or (map? (ffirst data)) (coll? (ffirst data)))
                     (first data)
                   (map? (first data))
                     data
                   :else
                     (map vector (first data)))
           rows (cond
                      (map? dat)
                        [dat]
                      (map? (first dat))
                        dat
                      :else 
                        (map #(apply assoc {} (interleave column-names %)) dat))] 
      (Dataset. (into [] column-names) rows))))
Vars in incanter.core/dataset: defn into let
Used in 0 other vars

Comments top

No comments for dataset. Log in to add a comment.