r2gtr                  package:ctc                  R Documentation

_W_r_i_t_e _t_o _g_t_r, _a_t_r, _c_d_t _f_i_l_e _f_o_r_m_a_t

_D_e_s_c_r_i_p_t_i_o_n:

     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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

    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

_D_e_t_a_i_l_s:

     Function 'hclust2treeview' compute hierarchical clustering and
     export to all files at once.

_A_u_t_h_o_r(_s):

     Antoine Lucas, <URL: http://antoinelucas.free.fr/ctc>

_R_e_f_e_r_e_n_c_e_s:

     Antoine Lucas and Sylvain Jasson, _Using amap and ctc Packages for
     Huge Clustering_, R News, 2006, vol 6, issue 5 pages 58-60.

_S_e_e _A_l_s_o:

     'r2xcluster', 'xcluster2r','hclust','hcluster'

_E_x_a_m_p_l_e_s:

     #    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

     # use library stats
     # 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")

