coerce                package:FLCore                R Documentation

_M_e_t_h_o_d _c_o_e_r_c_e

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

     Coercion methods for various sets of classes are generated using
     the 'coerce' function. Users should call the corresponding
     generated  'as()' method, with arguments equal to the object to
     coerce and the name of the  class to convert to.

     Coercion combinations work by transferring or transforming
     relevant slots from the  original object and placing them in a new
     object of the target class. The descriptions  below document how
     slots for each pair of classes are transfered or transformed. In
     all  cases the 'name' and 'desc' slots are simply copied accross.

_G_e_n_e_r_i_c _f_u_n_c_t_i_o_n:

     coerce(from, to, strict)

_M_e_t_h_o_d_s:


     _f_r_o_m=_F_L_B_i_o_l, _t_o=_F_L_S_t_o_c_k: 'n' to 'stock.n', 'wt' to 'stock.wt', 'm'
          to 'm','fec' to 'mat','spwn' to 'm.spwn'

     _f_r_o_m=_F_L_S_t_o_c_k, _t_o=_F_L_B_i_o_l: 'stock.n' to 'n', 'stock.wt' to 'wt', 'm'
          to 'm','mat' to 'fec','m.spwn' to 'spwn'

     _f_r_o_m=_F_L_S_t_o_c_k, _t_o=_F_L_C_a_t_c_h: 'catch.n' to 'catch.n', 'catch.wt' to
          'catch.wt', 'catch' to 'catch', 'landings.n' to 'landings.n',
           'landings.wt' to 'landings.wt', 'landings' to 'landings', 
          'discards.n' to 'discards.n', 'discards.wt' to 'discards.wt',
          'discards' to 'discards', 'name' to 'name'

     _f_r_o_m=_F_L_S_t_o_c_k,_t_o=_F_L_M_e_t_i_e_r As before but creating an 'FLMetier'
          object with a  single catch element.

     _f_r_o_m=_F_L_S_t_o_c_k,_t_o=_F_L_F_l_e_e_t As before but creating an 'FLFleet' object
          with a  single metier and catch.

     _f_r_o_m=_F_L_Q_u_a_n_t,_t_o=_F_L_C_o_h_o_r_t An 'FLCohort-class' object is created
          from the year-structured data in an 'FLQuant'. See 'FLCohort'
          for a  description of the exact procedure.

     _f_r_o_m=_F_L_C_o_h_o_r_t,_t_o=_F_L_Q_u_a_n_t The previous calculation is reversed and
          an  'FLQuant' is returned.

     _f_r_o_m=_F_L_l_s_t,_t_o=_l_i_s_t An standard R 'list' object is created from an
          'FLlst-class' by dropping the extra attributes.

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

     The FLR Team

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

     FLComp

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

     data(ple4)
     flb <- as(ple4, 'FLBiol')

