r2gtr {ctc}R Documentation

Write to gtr, atr, cdt file format

Description

Write data frame and hclust object to gtr atr, cdt files (Xcluster or Cluster output). Visualisation of cluster can be done with tools like treeview

Usage

r2gtr(hr,file="cluster.gtr",distance="euclidean",dec='.',digits=5)
r2atr(hc,file="cluster.atr",distance="euclidean",dec='.',digits=5)
r2cdt(hr,hc,data,labels=FALSE,description=FALSE,file="cluster.cdt",dec='.')

Arguments

file the path of the file
data a matrix (or data frame) which provides the data to put into the file
hr,hc objects of class hclust (rows and columns)
distance The distance measure used. This must be one of `"euclidean"', `"maximum"', `"manhattan"', `"canberra"' or `"binary"'. Any unambiguous substring can be given.
digits number digits for precision
labels a logical value indicating whether we use the frist column as labels (NAME column for cluster file)
description a logical value indicating whether we use the second column as description (DESCRIPTION column for cluster file)
dec the character used in the file for decimal points

Author(s)

Antoine Lucas, http://genopole.toulouse.inra.fr/~lucas/R

See Also

r2xcluster, xcluster2r,hclust

Examples

#    Create data
.Random.seed <- c(1,  416884367 ,1051235439)
m <- matrix(rep(1,3*24),ncol=3)  
m[9:16,3] <- 3 ; m[17:24,] <- 3    #create 3 groups
m <- m+rnorm(24*3,0,0.5)           #add noise
m <- floor(10*m)/10                #just one digits

library(mva)
# Cluster columns
hc <- hclust(dist(t(m)))
# Cluster rows
hr <- hclust(dist(m))

# Export files
r2atr(hc,file="cluster.atr")
r2gtr(hr,file="cluster.gtr")
r2cdt(hr,hc,m ,file="cluster.cdt")


[Package ctc version 1.2.7 Index]