abundance                package:CTFS                R Documentation

_A_b_u_n_d_a_n_c_e _o_f _T_r_e_e_s _b_y _C_a_t_e_g_o_r_i_e_s (_U_s_e_r _D_e_f_i_n_e_d _G_r_o_u_p_s)

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

     Computes the population size of trees (number alive) for user
     defined groups of trees.  A single dataset is used.  Abundance and
     other statistics are computed for user defined categories.

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

     abundance(census1, alivecode = c("A"), mindbh = 10,
                         split1 = NULL, split2 = NULL)

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

 census1: name of census datafile for a single census

alivecode: character, codes of the variable 'status'  that indicate the
          tree is alive.  The most general valid categories are: "A"
          and  "AB" and "AS".

  mindbh: Minimum DBH for computing population size in each  census

  split1: a *vector* of categorical values of the same  length as
          'datafile' which groups trees into classes of  interest for
          which abundance values are computed.  This vector can be 
          composed of charcters or numbers.

  split2: a second *vector* of categorical values of the same  length
          as 'datafile' which groups trees into classes of  interest
          for which abundance values are computed.  This vector can be 
          composed of charcters or numbers.

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

     See 'CTFS.abundance' for details on the computation methods of
     abundance and associated functions.  Values for only 1 census can
     be computed at a time.  A tree is included for the computation
     based on its value for 'status' and 'dbh' for a single census.

     The vectors 'split1' and 'split2' must be of the same length as
     'census1' and 'census2' but can contain NAs. 

     The results of 'abundance' can be organized into *dataframes* with
     the use of 'assemble.demography'.

_V_a_l_u_e:

     'abundance'returns a *list of arrays* with the values of 'split1'
     as the first dimension and the values of 'split2' as the second
     dimension of the array.  The array contains the following named
     components:

      $N: the abundance of each category, population size

$meandbh: the mean dbh in mm for trees used to compute  abundance

$meandate: mean date of census for trees used to compute abundance


     If the vector(s) 'split1' and 'split2' are provided by the user,
     then abundance and associated statistics are computed for each
     value of the vectors.  The vectors are nested so that abundance
     rates is computed for each category of 'split2' within each
     category of 'split1'.  Abundance values are returned for all
     levels of each vector and if no value can be computed then 0 or
     'NA' is returned as appropriate.

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

     Rick Condit, Suzanne Lao and Pamela Hall

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

     'CTFS.abundance'

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

     ## Not run: 
     1. Default use of abundance
     abund.out <- abundance(tst.bci90.full)
     names(abund.out)
     abund.out$N
     abund.out[[1]]

     2. Create vectors that categorize each tree by species name 
     and habitat.  This is the same process are used for other dynamic 
     functions (eg growth, abundance) but the vectors made MUST be put 
     together as a list.

     spp.vct <- tst.bci9095.full$sp
     hab.vct <- sep.quadinfo(tst.bci9095.full,bciquad.info,by.col="hab")->hab.vct
     abund.hab <- abundance("tst.bci9095.full",split1=hab.vct)

     3. Create vectors that define the quadrate of tree and species to run 
     with abundance().  Compare to result of abundance.quad() 

     NOTE: the number of dimensions in the returned arrays may NOT be equal to the
     number of quadrates in the plot if the census data used did not have
     at least 1 tree in each quadrate.  Note the results of these test
     files.

     spp.vct <- tst.bci90.full$sp

     create a vector of quadrates, 2 ways to do it:

     quad.vct <- gxgy.to.index(tst.bci90.full$gx,tst.bci90.full$gy,gridsize=20,plotdim=c(1000,500))
     quad.vct <- sep.quadinfo(tst.bci90.full,bciquad.info,by.col="quad")

     run abundance() and abundance.quad() and compare results

     abund.sp.quad.out <- abundance(tst.bci90.full,split1=spp.vct,split2=quad.vct)
     abund.quad.out <- abundance.quad(tst.bci90.full,gridsize=20)
     identical(abund.sp.quad.out[[1]],abund.quad.out[[1]])
     ## End(Not run)

