              (matrix/multiply-row m row-i weight))
            mat
            (utils/with-indices weights))))
-    (matrix-stats/mean (matrix mat))))
+    (matrix-stats/mean (matrix/matrix mat))))
 
 ; It's a vector...
 (defmethod weighted-mean [false true]



(defn xy-clusters-to-nmat2 [clusters]
  (named-matrix
    (map :id clusters) ; row names
    [:x :y] ; column names
    (matrix (map :center clusters))))



  "Dist matrix"
  ([m] (dist-matrix m m))
  ([m1 m2]
   (matrix/matrix
     (map
       (fn [r1]
         (map
