1.2.3-SNAPSHOT Arrow_down_16x16
  • (plus & args)
Performs element-by-element addition on multiple matrices, sequences
and/or numbers. Equivalent to R's + operator.

Examples:

(def A (matrix [[1 2 3]
[4 5 6]
[7 8 9]]))
(plus A A A)
(plus A 2)
(plus 2 A)
(plus [1 2 3] [1 2 3])
(plus [1 2 3] 2)
(plus 2 [1 2 3])


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

(defn plus
"   Performs element-by-element addition on multiple matrices, sequences
    and/or numbers. Equivalent to R's + operator.

    Examples:

      (def A (matrix [[1 2 3]
                      [4 5 6]
                      [7 8 9]]))
      (plus A A A)
      (plus A 2)
      (plus 2 A)
      (plus [1 2 3] [1 2 3])
      (plus [1 2 3] 2)
      (plus 2 [1 2 3])


"
   ([& args] (reduce (fn [A B] (combine-with A B clojure.core/+ plus)) args)))
Vars in incanter.core/plus: defn fn reduce +
Used in 0 other vars

Comments top

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