vardist                package:labdsv                R Documentation

_V_a_r_i_a_b_l_e _P_a_i_r_w_i_s_e _D_i_f_f_e_r_e_n_c_e

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

     Calculates a matrix of pair-wise differences between value for a
     particular numeric variable for a dataset.

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

     vardist(x)

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

       x: a vector of numeric values

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

     Calculates the absolute value of the difference between all
     possible values in a vector, producing a matrix of differences
     with as many rows and columns as the length of the vector

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

     an object of class 'dist'

_N_o_t_e:

     This function can be used to compare the compositional differences
     among samples to the environmental differences by correlation or 
     regression, or perhaps other routines.

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

     David W. Roberts droberts@montana.edu <URL:
     http://ecology.msu.montana.edu/droberts>

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

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

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

         data(bryceveg) # returns a vegetation data.frame called bryceveg
         data(brycesite) # returns an environmental data.frame called brycesite
         dis.bc <- dsvdis(bryceveg,'bray/curtis') # returns a Bray/Curtis dissimilarity matrix
         dis.elev <- vardist(brycesite$elev) # matrix of pair-wide differences in elevation
         cor(as.vector(dis.bc),as.vector(dis.elev))

