distances              package:Rtreemix              R Documentation

_D_i_f_f_e_r_e_n_t _d_i_s_t_a_n_c_e_s _b_e_t_w_e_e_n _t_w_o _g_i_v_e_n _v_e_c_t_o_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions are used for calculating different distances
     between two given vectors. Thus, 'L1.dist' calculates the L1
     distance, 'cosin.dist' calculates the cosine distance,
     'euclidian.dist' computes the Euclidian distance, and
     'rank.cor.dist' computes the rank correlation distance. The
     vectors have to have same length. When using 'rank.cor.dist' the
     vectors have to have length larger than 4.

_U_s_a_g_e:

     L1.dist(p, q)
     cosin.dist(p, q)
     euclidian.dist(x, y)
     rank.cor.dist(x, y)

_A_r_g_u_m_e_n_t_s:

       p: A 'numeric' vector specifying the first component for the
          distance calculation. It has to have the same length as 'q'.

       q: A 'numeric' vector specifying the second component for the
          distance calculation. 

       x: Same as 'p'. 

       y: Same as 'q'.

_V_a_l_u_e:

     The functions return the distance between the two given vectors.

_A_u_t_h_o_r(_s):

     Jasmina Bogojeska

_S_e_e _A_l_s_o:

     'kullback.leibler', 'L2.norm', 'stability.sim'

_E_x_a_m_p_l_e_s:

     ## Define two numeric vectors with equal lengths (> 4).
     x <- c(1, 2, 3, 4, 5)
     y <- c(5, 6, 7, 8, 9)

     ## Calculate the L1 distance between the vectors x and y
     L1.dist(x, y)

     ## Calculate the Euclidian distance between the vectors x and y
     euclidian.dist(x, y)

     ## Calculate the cosine distance between the vectors x and y
     cosin.dist(x, y)

     ## Calculate the rank-correlation distance between the vectors x and y
     rank.cor.dist(x, y)

