info                package:flexclust                R Documentation

_G_e_t _I_n_f_o_r_m_a_t_i_o_n _o_n _F_i_t_t_e_d _F_l_e_x_c_l_u_s_t _O_b_j_e_c_t_s

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

     Returns descriptive information about fitted flexclust objects
     like cluster sizes or sum of within-cluster distances.

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

     ## S4 method for signature 'flexclust, character':
     info(object, which, drop=TRUE, ...)

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

  object: fitted object.

   which: which information to get. Use 'which="help"' to list
          available information.

    drop: logical. If 'TRUE' the result is coerced to the lowest
          possible dimension.

     ...: passed to methods.

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

     Function 'info' can be used to access slots of fitted flexclust
     objects in a portable way, and in addition computes some
     meta-information like sum of within-cluster distances.

     Function 'infoCheck' returns a logical value that is 'TRUE' if the
     requested information can be computed from the 'object'.

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

     Friedrich Leisch

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

     'info'

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

     data("Nclus")
     plot(Nclus)

     cl1 = cclust(Nclus, k=4)
     summary(cl1)

     ## these two are the same
     info(cl1)
     info(cl1, "help")

     ## cluster sizes
     i1 = info(cl1, "size")
     i1

     ## average within cluster distances
     i2 = info(cl1, "av_dist")
     i2

     ## the sum of all within-cluster distances
     i3 = info(cl1, "distsum")
     i3

     ## sum(i1*i2) must of course be the same as i3
     stopifnot(all.equal(sum(i1*i2), i3))


     ## This should return TRUE
     infoCheck(cl1, "size")
     ## and this FALSE
     infoCheck(cl1, "Homer Simpson")
     ## both combined
     i4 = infoCheck(cl1, c("size", "Homer Simpson"))
     i4

     stopifnot(all.equal(i4, c(TRUE, FALSE)))

