Skip to contents

This function calculates the total basal area for each species present in a quadrat for each year of data collection. Both the absolute basal area (in the same units of area as the input data.frame) is returned, as well as the percentage of the total occupied basal area in the quadrat that is occupied by a given species ("percent total basal area"). If you'd like to ultimately calculate the population growth rate (lambda) for each species, you can use the getLambda function directly, which takes raw species occurrence data (like in 'dat' here) and returns lambda values for each species and quadrat for each transition in the dataset. This function should only be used if the individuals in 'dat' were mapped as polygons that are representative of their actual basal area, i.e. were not mapped as points.

Usage

getBasalAreas(
  dat,
  inv,
  species = "Species",
  quad = "Quad",
  site = "Site",
  year = "Year",
  geometry = "geometry",
  ...
)

Arguments

dat

An sf data.frame in which each row represents a unique polygon (either a genet or a ramet) in a unique site/quadrat/year combination. A data.frame returned by trackSpp can be put directly into this function. However, it is not necessary for 'dat' to have demographic data or unique identifiers (i.e. 'trackIDs') assigned. 'dat' must have columns that contain...

  • a unique identification for each research site in character format with no NAs (the default column name is "Site")

  • species name in character format with no NAs (the default column name is "Species")

  • unique quadrat identifier in character format with no NAs (the default column name is "Quad")

  • year of data collection in integer format with no NAs (the default column name is "Year")

  • an s.f 'geometry' column that contains a polygon or multipolygon data type for each individual observation (the default column name is "geometry")

This function should only be used if the individuals in 'dat' were mapped as polygons that are representative of their actual basal area, i.e. were not mapped as points.

inv

The name of each element of the list is a quadrat name in 'dat', and the contents of that list element is a numeric vector of all of the years in which that quadrat (or other unique spatial area) was sampled. Make sure this is the years the quadrat was actually sampled, not just the years that have data in the 'dat' argument! This argument allows the function to differentiate between years when the quadrat wasn't sampled and years when there just weren't any individuals of a species present in that quadrat.

species

An optional character string argument. Indicates the name of the column in 'dat' that contains species name data. It is unnecessary to include a value for this argument if the column name is "Species" (default value is 'Species').

quad

An optional character string argument. Indicates the name of the column in 'dat' that contains quadrat name data. It is unnecessary to include a value for this argument if the column name is "Quad" (default is 'Quad').

site

An optional character string argument. Indicates the name of the column in 'dat' that contains site name data. It is unnecessary to include a value for this argument if the column name is "Site" (default value is 'Site').

year

An optional character string argument. Indicates the name of the column in 'dat' that contains data for year of sampling. It is unnecessary to include a value for this argument if the column name is "Year" (default is 'Year').

geometry

An optional character string argument. Indicates the name of the column in 'dat' that contains sf geometry data. It is unnecessary to include a value for this argument if the column name is "geometry" (default is 'geometry').

...

Other arguments passed on to methods. Not currently used.

Value

getBasalAreas() returns a data.frame with the columns "Site", "Quad", "Year" and "Species". No two rows will have the same values for all four of these columns. The column "absolute_basalArea" has the area of the quadrat that is occupied by a species in a given unique site/quadrat/year combination. This is in the same units as the area in 'dat'. "quad_basalArea" gives the combined basal area of all organisms in a given site/quadrat/year. "percent_basalArea" gives the percentage of occupied basal area within a quadrat that is occupied by each species in a given site/quadrat/year. For example, species A has a basal area of 22 cm^2 in quadrat 1 in 2005 ("absolute_basalArea = 22). In 2005, there are 50 cm^2 of quadrat 1 that are occupied by organisms ("quad_basalArea" = 55). 44% of the occupied basal area in quadrat 1 in 2005 is occupied by species A ("percent_basalArea" = 44). There may be an 'NA' in the "percent_basalArea" column if the "quad_basalArea" for that species and year is 0.

See also

getLambda(), which uses this function to calculate basal areas and ultimately return population growth rates (lambdas) for each species in each quadrat.

Examples

dat <- grasslandData[grasslandData$Site == "AZ" &
 grasslandData$Year %in% c(1922:1925),]
names(dat)[1] <- "speciesName"
inv <- grasslandInventory[unique(dat$Quad)]
outDat <- trackSpp(dat = dat,
 inv = inv,
 dorm = 1,
 buff = .05,
 buffGenet = 0.005,
 clonal = data.frame("Species" = unique(dat$speciesName),
 "clonal" = c(TRUE,FALSE)),
 species = "speciesName",
 aggByGenet = TRUE
 )
#> Site: AZ
#> -- Quadrat: SG2
#> ---- Species: Heteropogon contortus
#> ; Bouteloua rothrockii
#> ; Ambrosia artemisiifolia
#> ; Calliandra eriophylla
#> Note: Individuals in year 1927 have a value of 'NA' in the 'survives_tplus1' and 'size_tplus1' columns because 1927 is the last year of sampling in this quadrat.
#> -- Quadrat: SG4
#> ---- Species: Bouteloua rothrockii
#> ; Ambrosia artemisiifolia
#> ; Calliandra eriophylla
#> Note: Individuals in year 1927 have a value of 'NA' in the 'survives_tplus1' and 'size_tplus1' columns because 1927 is the last year of sampling in this quadrat.
#> Note: The output data.frame from this function is shorter than your input data.frame because demographic data has been aggregated by genet. Because of this, some columns that were present in your input data.frame may no longer be present. If you don't want the output to be aggregated by genet, include the argument 'aggByGenet == FALSE' in your call to trackSpp().
getBasalAreas(dat = outDat, inv = inv,
species = "speciesName")
#>    Site Quad Year             speciesName absolute_basalArea quad_basalArea
#> 1    AZ  SG2 1922 Ambrosia artemisiifolia       8.862780e-04    0.036796013
#> 2    AZ  SG2 1922   Heteropogon contortus       2.820466e-02    0.036796013
#> 3    AZ  SG2 1922    Bouteloua rothrockii       7.655839e-03    0.036796013
#> 4    AZ  SG2 1922   Calliandra eriophylla       4.923767e-05    0.036796013
#> 5    AZ  SG2 1923    Bouteloua rothrockii       4.225758e-03    0.034943462
#> 6    AZ  SG2 1923 Ambrosia artemisiifolia       0.000000e+00    0.034943462
#> 7    AZ  SG2 1923   Heteropogon contortus       3.071770e-02    0.034943462
#> 8    AZ  SG2 1923   Calliandra eriophylla       0.000000e+00    0.034943462
#> 9    AZ  SG2 1924 Ambrosia artemisiifolia       0.000000e+00    0.034182001
#> 10   AZ  SG2 1924    Bouteloua rothrockii       4.278202e-03    0.034182001
#> 11   AZ  SG2 1924   Calliandra eriophylla       4.923767e-05    0.034182001
#> 12   AZ  SG2 1924   Heteropogon contortus       2.985456e-02    0.034182001
#> 13   AZ  SG2 1925 Ambrosia artemisiifolia       0.000000e+00    0.014798927
#> 14   AZ  SG2 1925    Bouteloua rothrockii       7.640600e-03    0.014798927
#> 15   AZ  SG2 1925   Calliandra eriophylla       7.385650e-05    0.014798927
#> 16   AZ  SG2 1925   Heteropogon contortus       7.084470e-03    0.014798927
#> 17   AZ  SG2 1926    Bouteloua rothrockii       0.000000e+00    0.000000000
#> 18   AZ  SG2 1926 Ambrosia artemisiifolia       0.000000e+00    0.000000000
#> 19   AZ  SG2 1926   Heteropogon contortus       0.000000e+00    0.000000000
#> 20   AZ  SG2 1926   Calliandra eriophylla       0.000000e+00    0.000000000
#> 21   AZ  SG2 1927    Bouteloua rothrockii       0.000000e+00    0.000000000
#> 22   AZ  SG2 1927   Calliandra eriophylla       0.000000e+00    0.000000000
#> 23   AZ  SG2 1927 Ambrosia artemisiifolia       0.000000e+00    0.000000000
#> 24   AZ  SG2 1927   Heteropogon contortus       0.000000e+00    0.000000000
#> 25   AZ  SG4 1922 Ambrosia artemisiifolia       2.461883e-04    0.002926715
#> 26   AZ  SG4 1922    Bouteloua rothrockii       2.680527e-03    0.002926715
#> 27   AZ  SG4 1922   Calliandra eriophylla       0.000000e+00    0.002926715
#> 28   AZ  SG4 1923 Ambrosia artemisiifolia       0.000000e+00    0.002782187
#> 29   AZ  SG4 1923    Bouteloua rothrockii       2.782187e-03    0.002782187
#> 30   AZ  SG4 1923   Calliandra eriophylla       0.000000e+00    0.002782187
#> 31   AZ  SG4 1924 Ambrosia artemisiifolia       0.000000e+00    0.002478312
#> 32   AZ  SG4 1924    Bouteloua rothrockii       2.404456e-03    0.002478312
#> 33   AZ  SG4 1924   Calliandra eriophylla       7.385650e-05    0.002478312
#> 34   AZ  SG4 1925 Ambrosia artemisiifolia       0.000000e+00    0.002199422
#> 35   AZ  SG4 1925    Bouteloua rothrockii       2.199422e-03    0.002199422
#> 36   AZ  SG4 1925   Calliandra eriophylla       0.000000e+00    0.002199422
#> 37   AZ  SG4 1926 Ambrosia artemisiifolia       0.000000e+00    0.000000000
#> 38   AZ  SG4 1926    Bouteloua rothrockii       0.000000e+00    0.000000000
#> 39   AZ  SG4 1926   Calliandra eriophylla       0.000000e+00    0.000000000
#> 40   AZ  SG4 1927 Ambrosia artemisiifolia       0.000000e+00    0.000000000
#> 41   AZ  SG4 1927    Bouteloua rothrockii       0.000000e+00    0.000000000
#> 42   AZ  SG4 1927   Calliandra eriophylla       0.000000e+00    0.000000000
#>    percent_basalArea
#> 1          2.4086251
#> 2         76.6513976
#> 3         20.8061648
#> 4          0.1338125
#> 5         12.0931293
#> 6          0.0000000
#> 7         87.9068707
#> 8          0.0000000
#> 9          0.0000000
#> 10        12.5159496
#> 11         0.1440456
#> 12        87.3400048
#> 13         0.0000000
#> 14        51.6294202
#> 15         0.4990666
#> 16        47.8715132
#> 17                NA
#> 18                NA
#> 19                NA
#> 20                NA
#> 21                NA
#> 22                NA
#> 23                NA
#> 24                NA
#> 25         8.4117628
#> 26        91.5882372
#> 27         0.0000000
#> 28         0.0000000
#> 29       100.0000000
#> 30         0.0000000
#> 31         0.0000000
#> 32        97.0198869
#> 33         2.9801131
#> 34         0.0000000
#> 35       100.0000000
#> 36         0.0000000
#> 37                NA
#> 38                NA
#> 39                NA
#> 40                NA
#> 41                NA
#> 42                NA