1.2.3-SNAPSHOT Arrow_down_16x16

col-names

incanter.core

  • (col-names data)
  • (col-names data colnames)
If given a dataset, it returns its column names. If given a dataset and a sequence
of column names, it returns a dataset with the given column names.

Examples:
(use '(incanter core datasets))
(def data (get-dataset :cars))
(col-names data)

(def renamed-data (col-names data [:x1 :x2]))
(col-names renamed-data)


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:1472 top

(defn col-names
  "If given a dataset, it returns its column names. If given a dataset and a sequence
   of column names, it returns a dataset with the given column names.

   Examples:
     (use '(incanter core datasets))
     (def data (get-dataset :cars))
     (col-names data)

     (def renamed-data (col-names data [:x1 :x2]))
     (col-names renamed-data)

 
    "
  ([data] (:column-names data)) 
  ([data colnames]
     (dataset colnames (to-list data))))
Vars in incanter.core/col-names: defn
Used in 0 other vars

Comments top

No comments for col-names. Log in to add a comment.