matrify                package:labdsv                R Documentation

_C_r_e_a_t_e _T_a_x_o_n _D_a_t_a._F_r_a_m_e_s _F_r_o_m _T_h_r_e_e _C_o_l_u_m_n _D_a_t_a_b_a_s_e _F_o_r_m

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

     Takes a data.frame in three column form (sample.id, taxon,
     abundance) and converts it into full matrix form, and then exports
     it as data.frame with the appropriate row.names and column names.

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

     matrify(data)

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

    data: a data.frame or matrix in three column format (or database)
          format, where the first column is the sample ID, the second
          column is the taxon ID, and the third sample is the abundance
          of that taxon in that sample.

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

     The routine is pure R code to convert data from database form to
     the sparse matrix form required by multivariate analyses in '' and
     '', as well as 'dist' and other routines.

_V_a_l_u_e:

     a data.frame with samples as rows, taxa as columns, and abudance
     values for taxa in samples.

_N_o_t_e:

     Typically, the source of the data will be an ASCII file of a dbase
     database or a CSV file from an Excel file in three column format. 
     That file can be read into a data.frame with 'read.table' or
     'read.csv' and then that data.frame can be matrified by this
     function.

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

     David W. Roberts droberts@montana.edu

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

     <URL: http://ecology.montana.msu.edu/labdsv/R/labdsv>

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

     'dematrify'

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

        x <- cbind(c('a','a','b','b','b','c','c'),
                   c('x','y','x','z','w','y','z'),
                   c(1,2,1,3,2,2,1))
        matrify(x) 

