title: Weighted Euclidean Distance in R
body: <p>I'd like to create a distance-matrix with weighted euclidean distances from a data frame. The weights will be defined in a vector. Here's an example:</p>
  
  <pre><code>library("cluster")
  
  a &lt;- c(1,2,3,4,5)
  b &lt;- c(5,4,3,2,1)
  c &lt;- c(5,4,1,2,3)
  df &lt;- data.frame(a,b,c)
  
  weighting &lt;- c(1, 2, 3)
  
  dm &lt;- as.matrix(daisy(df, metric = "euclidean", weights = weighting))
  </code></pre>
  
  <p>I've searched everywhere and can't find a package or solution to this in R. The 'daisy' function within the 'cluster' package claims to support weighting, but the weights don't seem to be applied and it just spits out regular euclid. distances.</p>
  
  <p>Any ideas Stack Overflow?</p>