• incanter

# minus

## incanter.core

• (minus & args)
Performs element-by-element subtraction on multiple matrices, sequences
and/or numbers. If only a single argument is provided, returns the
negative of the given matrix, sequence, or number. Equivalent to R's - operator.

Examples:

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

### Source incanter/core.clj:423 top

```(defn minus
"   Performs element-by-element subtraction on multiple matrices, sequences
and/or numbers. If only a single argument is provided, returns the
negative of the given matrix, sequence, or number. Equivalent to R's - operator.

Examples:

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

"
;([& args] (reduce (fn [A B] (combine-with A B clojure.core/- minus)) args)))
([& args] (if (= (count args) 1)
(combine-with 0 (first args) clojure.core/- minus)
(reduce (fn [A B] (combine-with A B clojure.core/- minus)) args))))```
Vars in incanter.core/minus: = count defn first fn reduce -
Used in 0 other vars