Skip to contents

Takes a CompadreDB object and calculates a grand mean fecundity matrix for each unique population (a mean of all population-specific fecundity matrices, including fecundity matrices for which MatrixComposite == 'Mean').

Populations are defined based on unique combinations of the columns 'SpeciesAuthor', 'MatrixPopulation', and 'MatrixDimension', (or optionally, a different set of columns supplied by the user).

The main purpose of this function is to identify stage classes that are potentially reproductive (i.e. the absence of fecundity in a given stage class and year does not necessarily indicate that the stage in question is non-reproductive).

Usage

cdb_mean_matF(
  cdb,
  columns = c("SpeciesAuthor", "MatrixPopulation", "MatrixDimension")
)

Arguments

cdb

A CompadreDB object

columns

Vector of column names from which unique populations should be identified. Defaults to c("SpeciesAuthor", "MatrixPopulation", "MatrixDimension").

Value

Returns a list of matrices, representing the mean fecundity matrix associated with each row of the database.

Author

Owen R. Jones <jones@biology.sdu.dk>

Danny Buss <dlb50@cam.ac.uk>

Julia Jones <juliajones@biology.sdu.dk>

Iain Stott <stott@biology.sdu.dk>

Patrick Barks <patrick.barks@gmail.com>

Examples

# print matF associated with row 16 of database
Compadre$mat[[16]]
#>   MatrixClassOrganized
#> 1                 prop
#> 2               active
#> 3               active
#> 4               active
#> 5               active
#> 6               active
#> 7               active
#>                                           MatrixClassAuthor
#> 1                                     Seeds in the seedbank
#> 2                                     Seedling: <1 year old
#> 3                               Small saplings: ≤ 0,072 cm²
#> 4                    Medium saplings: 0,072 < d ≤ 0,787 cm²
#> 5                    Large saplings: 0,787 < d ≤ 19,643 cm²
#> 6 Small adults: (with reproduction) 19,643 < d ≤ 63,643 cm²
#> 7            Large adults: (with reproduction) > 63,643 cm²
#> 
#> matA:
#>       1     2     3     4     5     6      7
#> 1 0.586 0.000 0.000 0.000 0.000 73.25 87.800
#> 2 0.015 0.000 0.000 0.000 0.000  1.24  1.490
#> 3 0.000 0.384 0.411 0.063 0.000  0.00  0.000
#> 4 0.000 0.384 0.429 0.785 0.000  0.00  0.000
#> 5 0.000 0.000 0.000 0.090 0.923  0.00  0.000
#> 6 0.000 0.000 0.000 0.000 0.020  0.88  0.000
#> 7 0.000 0.000 0.000 0.000 0.000  0.02  0.962
#> 
#> matU:
#>       1     2     3     4     5    6     7
#> 1 0.586 0.000 0.000 0.000 0.000 0.00 0.000
#> 2 0.015 0.000 0.000 0.000 0.000 0.00 0.000
#> 3 0.000 0.384 0.411 0.063 0.000 0.00 0.000
#> 4 0.000 0.384 0.429 0.785 0.000 0.00 0.000
#> 5 0.000 0.000 0.000 0.090 0.923 0.00 0.000
#> 6 0.000 0.000 0.000 0.000 0.020 0.88 0.000
#> 7 0.000 0.000 0.000 0.000 0.000 0.02 0.962
#> 
#> matF:
#>   1 2 3 4 5     6     7
#> 1 0 0 0 0 0 73.25 87.80
#> 2 0 0 0 0 0  1.24  1.49
#> 3 0 0 0 0 0  0.00  0.00
#> 4 0 0 0 0 0  0.00  0.00
#> 5 0 0 0 0 0  0.00  0.00
#> 6 0 0 0 0 0  0.00  0.00
#> 7 0 0 0 0 0  0.00  0.00
#> 
#> matC:
#>   1 2 3 4 5 6 7
#> 1 0 0 0 0 0 0 0
#> 2 0 0 0 0 0 0 0
#> 3 0 0 0 0 0 0 0
#> 4 0 0 0 0 0 0 0
#> 5 0 0 0 0 0 0 0
#> 6 0 0 0 0 0 0 0
#> 7 0 0 0 0 0 0 0
#> 

# create list of meanMatFs
meanF <- cdb_mean_matF(Compadre)

# print meanMatF associated with row 16 of database
meanF[[16]]
#>    F1 F2 F3 F4 F5        F6         F7
#> F1  0  0  0  0  0 77.316667 261.666667
#> F2  0  0  0  0  0  1.306667   4.196667
#> F3  0  0  0  0  0  0.000000   0.000000
#> F4  0  0  0  0  0  0.000000   0.000000
#> F5  0  0  0  0  0  0.000000   0.000000
#> F6  0  0  0  0  0  0.000000   0.000000
#> F7  0  0  0  0  0  0.000000   0.000000