rdist                 package:fields                 R Documentation

_E_u_c_l_i_d_e_a_n _d_i_s_t_a_n_c_e _m_a_t_r_i_x

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

     Given two sets of locations computes the Euclidean distance 
     matrix among all pairings.

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

     rdist(x1, x2)

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

      x1: Matrix of first set of locations where each row gives the
          coordinates of a particular point. 

      x2: Matrix of second set of locations where each row gives the
          coordinates of a particular point. If this is missing x1 is
          used.  

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

     Let D be the mXn distance matrix.  The elements are  the Euclidean
     distances between the all locations x1[i,] and x2[j,].

     D.ij = sqrt(  sum.k (( x1[i,k] - x2[j,k]) **2 ).

     FORTRAN: The default function calls FORTRAN to evaluate the
     distances. A pure S code version also exists: rdist.S

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

     The distance matrix if nrow(x1)=m and nrow( x2)=n then the
     returned matrix will be mXn.

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

     exp.cov, rdist.earth

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

     out<- rdist( ozone$x)
     # out is a 20X20 matrix.
     out2<- rdist( ozone$x[1:5,], ozone$x[11:20,])
     #out2 is a 5X10 matrix

