load a local rmd matrix

Issue #289 resolved
rene created an issue

hi i want to make a dendrogram with my own local rmd matrix, it is possible? and how i can load my local mrsd matrix ?

Comments (4)

  1. Xinqiu Yao

    Hi,

    If your rmsd matrix is a plain ascii file, use read.table() to read it into R. See help(read.table) for more details. Then, you can get the dendrogram by calling e.g. hclust(). Here is a simple example,

    # assume the rmsd matrix is saved in a text file named 'rmsd.txt', and each column of the matrix is separated by space
    dmat <- read.table('rmsd.txt')
    hc <- hclust(as.dist(dmat))
    
    # simply plot the dendrogram
    plot(hc)
    
    # nicer plot of dendrogram
    hclustplot(hc, k=2)
    
    # convert to a 'dendrogram' object
    dend <- as.dendrogram(hc)
    
  2. Log in to comment