shrinkVector           package:HilbertVis           R Documentation

_s_h_r_i_n_k _a _v_e_c_t_o_r _b_y _p_a_r_t_i_t_i_o_n_i_n_g _i_t _i_n_t_o _b_i_n_s _a_n_d _t_a_k_i_n_g _t_h_e _m_a_x_i_m_a _i_n
_t_h_e _b_i_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     Given a (potentially very long) vector, the vector is partitioned
     into a given  number of (up to rounding errors) equally long
     parts, and a vector of the  maxima within each of the parts it
     returned.

_U_s_a_g_e:

     shrinkVector(vec, newLength)

_A_r_g_u_m_e_n_t_s:

     vec: The vector to be shrunk. May be numeric or integer.

newLength: The desired size of the return vector, i.e., the number of
          partitions 

_D_e_t_a_i_l_s:

     This function is useful when plotting a very long vector such as
     those returned by 'ShortRead::pileup'. For a sufficiently long
     vector 'x',  the two commands 'plot( x, type="h" )' and 'plot(
     shrinkVector( x, 10000 ), type="h" )' produce essential the same
     plot (up to a rescaling of the x axis) but the former takes much
     longer to execute because R plots many needles on top of each
     other. The function 'plotLongVector' is a simple wrapper around
     this function.

_V_a_l_u_e:

     A vector of length 'newLength' with the maxima of each of the
     partitions of 'vector'.

_N_o_t_e:

     Note that, as the maximum is returned, the result may mot be what
     you want if negative numbers are present. Note further that NAs
     may not be handles correctly.

_A_u_t_h_o_r(_s):

     Simon Anders, EMBL-EBI (sanders\@fs.tum.de)

_S_e_e _A_l_s_o:

     'plotLongVector', 'ShortRead::pileup', 
     'HilbertVisGui::simpleLinPlot'

_E_x_a_m_p_l_e_s:

        shrinkVector( 100000 + 1:1000, 17 )

