FLStock-class             package:FLCore             R Documentation

_C_l_a_s_s _F_L_S_t_o_c_k

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

     Data representation for a stock object. The 'FLStock' object
     contains the available information for a fish stock, usually
     derived from a national or international sampling program, that
     will be used for conducting an assessment. Typically this will
     include information on total catches. In addition information on
     catch numbers, catch weights, maturity, natural mortality etc. may
     be provided.

     The 'FLStock' object also contains the slots stock, stock.n and
     harvest to hold information resulting from an analytical
     assessment.

_S_l_o_t_s:


     _c_a_t_c_h ('FLQuant') Total catch weight by year

     _c_a_t_c_h._n ('FLQuant') Catch numbers by quant and year

     _c_a_t_c_h._w_t ('FLQuant') Catch weights by quant and year

     _d_i_s_c_a_r_d_s ('FLQuant') Total discards weight by year

     _d_i_s_c_a_r_d_s._n ('FLQuant') Discard numbers by quant and year

     _d_i_s_c_a_r_d_s._w_t ('FLQuant') Discard weights by quant and year

     _l_a_n_d_i_n_g_s ('FLQuant') Total landings weight by year

     _l_a_n_d_i_n_g_s._n ('FLQuant') Landing numbers by quant and year

     _l_a_n_d_i_n_g_s._w_t ('FLQuant') Landing weights by quant and year

     _s_t_o_c_k ('FLQuant') Total stock weight by year

     _s_t_o_c_k._n ('FLQuant') Stock numbers by quant and year

     _s_t_o_c_k._w_t ('FLQuant') Stock weights by quant and year

     _m ('FLQuant') Natural mortality by quant and year

     _m_a_t ('FLQuant') Proportion mature by quant and year

     _h_a_r_v_e_s_t ('FLQuant') Harvest rate or fishing mortality by quant and
          year. The units of the FLQuant should be set to 'harvest' or
          'f' accordingly

     _h_a_r_v_e_s_t._s_p_w_n ('FLQuant') Proportion of harvest/fishing mortality
          before spawning by quant and year

     _m._s_p_w_n ('FLQuant') Proportion of natural mortality before spawning
          by quant and year

     _n_a_m_e ('character') Name of the stock

     _d_e_s_c ('character') Description of stock

     _r_a_n_g_e ('numeric') Named vector containing the dimensions of the
          stock object

_E_x_t_e_n_d_s:


          FLComp

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


     [(_b_a_s_e) : Subsets an FLStock by subsetting each FLQuant slot in
          the object

      ' signature(x=FLStock,i=ANY,j=ANY,drop=missing) '

     [<-(_b_a_s_e) : Assign to a subset of an FLStock an FLStock of
          equivalent dimension

      ' signature(x=FLStock,i=ANY,j=ANY,value=missing) '

     _a_s._F_L_B_i_o_l(_F_L_C_o_r_e) : Convert an FLStock object to an FLBiol object

      ' signature(object=missing) '

     _a_s._F_L_S_R(_F_L_C_o_r_e) : Initialise an FLSR object from an FLStock object

      ' signature(object=missing) '

     _c_a_t_c_h(_F_L_C_o_r_e) : Get the catch slot from an FLStock object

      ' signature(object=missing) '

     _c_a_t_c_h<-(_F_L_C_o_r_e) : Assign values to the catch slot of an FLStock
          object

      ' signature(object=FLStock,value=FLQuant) '

     _c_a_t_c_h<-(_F_L_C_o_r_e) : Assign values to the catch, catch.n and catch.wt
          slots of an FLStock object

      ' signature(object=FLStock,value=FLQuants) '

     _c_a_t_c_h._n(_F_L_C_o_r_e) : Get the catch.n slot of an FLStock object

      ' signature(object=missing) '

     _c_a_t_c_h._n<-(_F_L_C_o_r_e) : Assign values to the catch.n slot of an
          FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _c_a_t_c_h._w_t(_F_L_C_o_r_e) : Get the catch.wt slot of an FLStock object

      ' signature(object=missing) '

     _c_a_t_c_h._w_t<-(_F_L_C_o_r_e) : Assign values to the catch.wt slot of an
          FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _c_o_e_r_c_e(_m_e_t_h_o_d_s) : Force an object of class FLStock to another
          class using as(from, to)

      ' signature(from=NULL,to=FLStock,strict=missing) '

     _c_o_e_r_c_e(_m_e_t_h_o_d_s) : Force an object of class FLBiol to an object of
          class FLStock. Uses as(from, to)

      ' signature(from=FLBiol,to=FLStock,strict=missing) '

     _c_o_e_r_c_e(_m_e_t_h_o_d_s) : Force an object of class FLStock be an object of
          class FLBiol. Uses as(from, to)

      ' signature(from=FLStock,to=FLBiol,strict=missing) '

     _c_o_m_p_u_t_e_C_a_t_c_h(_F_L_C_o_r_e) : Calculate the total catch weight by year
          for an FLStock

      ' signature(object=missing) '

     _c_o_m_p_u_t_e_D_i_s_c_a_r_d_s(_F_L_C_o_r_e) : Calculate the total discards weight by
          year for an FLStock

      ' signature(object=missing) '

     _c_o_m_p_u_t_e_L_a_n_d_i_n_g_s(_F_L_C_o_r_e) : Calculate the total landings weight by
          year for an FLStock

      ' signature(object=missing) '

     _d_i_s_c_a_r_d_s(_F_L_C_o_r_e) : Get the discards slot of an FLStock object

      ' signature(object=missing) '

     _d_i_s_c_a_r_d_s<-(_F_L_C_o_r_e) : Assign values to the discards slot of an
          FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _d_i_s_c_a_r_d_s._n(_F_L_C_o_r_e) : Get the discards.n slot of an FLStock object

      ' signature(object=missing) '

     _d_i_s_c_a_r_d_s._n<-(_F_L_C_o_r_e) : Assign values to the discards.n slot of an
          FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _d_i_s_c_a_r_d_s._w_t(_F_L_C_o_r_e) : Get the discards.wt slot of an FLStock
          object

      ' signature(object=missing) '

     _d_i_s_c_a_r_d_s._w_t<-(_F_L_C_o_r_e) : Assign values to the discards.wt slot of
          an FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _h_a_r_v_e_s_t(_F_L_C_o_r_e) : Get the harvest slot of an FLStock object

      ' signature(object=missing) '

     _h_a_r_v_e_s_t<-(_F_L_C_o_r_e) : Assign values to the units of the harvest slot
          of an FLStock object

      ' signature(object=FLStock,value=character) '

     _h_a_r_v_e_s_t<-(_F_L_C_o_r_e) : Assign values to the harvest slot of an
          FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _h_a_r_v_e_s_t._s_p_w_n(_F_L_C_o_r_e) : Get the harvest.spwn slot from an FLStock
          object

      ' signature(object=missing) '

     _l_a_n_d_i_n_g_s(_F_L_C_o_r_e) : Get the landings slot of an FLStock object

      ' signature(object=missing) '

     _l_a_n_d_i_n_g_s<-(_F_L_C_o_r_e) : Assign values to the landings slot of an
          FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _l_a_n_d_i_n_g_s._n(_F_L_C_o_r_e) : Get the landings.n slot from an FLStock
          object

      ' signature(object=missing) '

     _l_a_n_d_i_n_g_s._n<-(_F_L_C_o_r_e) : Assign values to the landings.n slot of an
          FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _l_a_n_d_i_n_g_s._w_t(_F_L_C_o_r_e) : Get the landings.wt slot of an FLStock
          object

      ' signature(object=missing) '

     _l_a_n_d_i_n_g_s._w_t<-(_F_L_C_o_r_e) : Assign values to the landings.wt slot of
          an FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _m(_F_L_C_o_r_e) : Get the m slot of an FLStock object

      ' signature(object=missing) '

     _m<-(_F_L_C_o_r_e) : Assign values to the m slot of an FLStock object

      ' signature(object=FLStock,value=FLQuant) '

     _m_a_t(_F_L_C_o_r_e) : Get the mat slot of an FLStock object

      ' signature(object=missing) '

     _m._s_p_w_n(_F_L_C_o_r_e) : Get the m.spwn slot of an FLStock object

      ' signature(object=missing) '

     _p_l_o_t(_g_r_a_p_h_i_c_s) : A summary plot of an FLStock object

      ' signature(x=FLStock,y=missing) '

     _s_s_b(_F_L_C_o_r_e) : Calculate SSB by year for an FLStock object

      ' signature(object=missing) '

     _s_s_b_p_u_r_e_c(_F_L_C_o_r_e) : Calculate SSB per recruit for an FLStock object

      ' signature(object=missing) '

     _s_t_o_c_k(_F_L_C_o_r_e) : Get the stock slot of an FLStock object

      ' signature(object=missing) '

     _s_t_o_c_k._n(_F_L_C_o_r_e) : Get the stock.n slot of an FLStock object

      ' signature(object=missing) '

     _s_t_o_c_k._w_t(_F_L_C_o_r_e) : Get the stock.wt slot of an FLStock object

      ' signature(object=missing) '

     _t_r_i_m(_F_L_C_o_r_e) : Trim an FLStock object to a reduced range over the
          year or quant dimension

      ' signature(object=missing) '

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

     The FLR Team

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

     [, [<-, as.FLBiol, as.FLSR, catch, catch<-, catch.n, catch.n<-,
     catch.wt, catch.wt<-, coerce, computeCatch, computeDiscards,
     computeLandings, discards, discards<-, discards.n, discards.n<-,
     discards.wt, discards.wt<-, harvest, harvest<-, harvest.spwn,
     landings, landings<-, landings.n, landings.n<-, landings.wt,
     landings.wt<-, m, m<-, mat, m.spwn, plot, ssb, ssbpurec, stock,
     stock.n, stock.wt, trim, FLComp

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

     data(ple4)

     landings(ple4) #get the landings slot
     landings(ple4) <- apply(landings.n(ple4)*landings.wt(ple4),2,sum)   # assign values to the landings slot

     discards(ple4) <- computeDiscards(ple4)

     harvest(ple4) <- 'f' # set the units of the harvest slot of an FLStock object

     catch(ple4) <- computeCatch(ple4)
     catch(ple4) <- computeCatch(ple4, slot="all")

     ple4[,1] # subset the FLStock
     trim(ple4, age=2:6, year=1980:1990) #trim the FLStock

     ssb(ple4) # calculate SSB
     ssbpurec(ple4) # calculate SSB per recruit

     biol <- as(ple4, "FLBiol")  # coerce an FLStock to an FLBiol
     flsr <- as.FLSR(ple4)       # initialise an FLSR object from an FLStock

