nlevels.default          package:wavethresh          R Documentation

_R_e_t_u_r_n_s _n_u_m_b_e_r _o_f _l_e_v_e_l_s _a_s_s_o_c_i_a_t_e_d _w_i_t_h _a_n _o_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     This function returns the number of scale levels associated with
     either a wavelet type object or an atomic object.

_U_s_a_g_e:

     nlevels.default(object, ...)

_A_r_g_u_m_e_n_t_s:

  object: An object for which you wish to determine how many levels it
          has or is associated with.

     ...: any other arguments

_D_e_t_a_i_l_s:

     This function first checks to see whether the input object has a
     component called nlevels. If it does then it returns the value of
     this component. If it does not then it takes the length of the
     object and then uses the 'IsPowerOfTwo' function to return the
     power of two which equals the length (if any) or NA if the length
     of the object is not a power of two.

_V_a_l_u_e:

     The number of resolution (scale) levels associated with the
     object.

_A_u_t_h_o_r(_s):

     Version 3.6.0 Copyright Guy Nason 1995

_S_e_e _A_l_s_o:

     'nlevels'

_E_x_a_m_p_l_e_s:

     #
     # Generate some test data 
     #
     #test.data <- example.1()$y
     #
     # Now, this vector is 512 elements long. What number of levels would any
     # wavelet object be that was associated with this vector?
     #
     #nlevels(test.data)
     # [1] 9
     #
     # I.e. 2^9=512. Let's check by taking the wavelet transform of the
     # test data and seeing how many levels it actually has
     #
     #nlevels(wd(test.data))
     # [1] 9

