bucket                package:wccsom                R Documentation

_V_a_r_i_a_b_l_e _a_v_e_r_a_g_i_n_g (_b_u_c_k_e_t_i_n_g) _f_o_r _d_a_t_a _m_a_t_r_i_c_e_s

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

     Function 'bucket' decreases the size (i.e., the number of columns)
     of a data matrix by averaging variables. Function 'debucket'
     achieves the reverse by linear interpolation.

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

     bucket(x, factor)
     debucket(x, nout)

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

       x: Data matrix: each variable corresponds with a column.

  factor: Bucket factor: this number of variables will be averaged.

    nout: Required number of variables after debucketing.

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

     Returns a data matrix of the new dimensions.

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

     Ron Wehrens

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

     data(cepha)
     gr <- somgrid(3,3, "hexagonal")
     set.seed(7)
     system.time(x <- WCCSOM(cepha$patterns, grid=gr, trwidth=20,
                             rlen=500, FineTune=FALSE))

     X <- bucket(cepha$patterns, 4)
     system.time(x <- WCCSOM(X, grid=gr, trwidth=5,
                             rlen=500, FineTune=FALSE))

