lunedì 21 maggio 2007

Conversion of column matrix into a vector without duplicate

A = matrix(c("a","b","c","d","e","u","v",rep("x",3)),5,2,byrow=F)

unique(A[, 2])

4 commenti:

  1. Do you know how to convert a vector into a distance matrix?

    RispondiElimina
  2. Questo commento è stato eliminato dall'autore.

    RispondiElimina
  3. Do you know how to convert a vector into a distance matrix?

    RispondiElimina
  4. Sorry for the 'out of time' answer:

    See this link to see what i mean for distance matrix.

    v = rnorm(100)
    dm = dist(v)
    # fake application
    # run hclust
    dm.hclust <- hclust(dm)
    # plot the dendrogram
    plot(dm.hclust, cex = 0.6)

    RispondiElimina