Occupied Patches Proportion Function

Functionality Overview

The Occupied Patches Proportion function in MetaCommunityMetrics.jl provides a simple yet powerful metric for understanding the distribution and prevalence of species across different sites within a metacommunity. By returning both a summary (the mean, minimum, and maximum proportion of sites occupied across species) and the full distribution of per-species proportions, this function helps ecologists assess the spatial extent of species distributions and identify potential patterns of rarity or commonness across the landscape.

This function draws on the concepts discussed by Ehrlén & Eriksson (2000) in their study on dispersal limitation and patchy occupancy in forest herbs. According to their findings, low occupancy may indicate dispersal limitation or strong competition, while high occupancy could suggest mass effects due to high dispersal rates or the ability to thrive in various conditions.

The Function

MetaCommunityMetrics.prop_patchesFunction
prop_patches(presence::AbstractVector, species::AbstractVector, site::AbstractVector) -> DataFrame

Calculate the proportion of sites occupied by each species, returning both summary statistics and the full distribution of per-species proportions.

This function takes three vectors: presence, species, and site, and performs the following steps:

  1. Calculates the proportion of sites occupied by each species across all sites.
  2. Summarizes the proportions across all species by returning the mean, minimum, and maximum, as well as the full distribution of per-species proportions.

Arguments

  • presence::AbstractVector: Vector representing the occurrence of species.
  • species::AbstractVector: Vector representing species names or IDs.
  • site::AbstractVector: Vector representing site names or IDs.

Returns Two outputs:

  • summary: A DataFrame containing the mean, minimum, and maximum proportion of sites occupied across all species.
  • distribution: A DataFrame containing the proportion of sites occupied for each species, providing the full distribution of per-species proportions to characterize the extent of site occupancy in the community.

Example

julia> using MetaCommunityMetrics

julia> df = load_sample_data()
53352×12 DataFrame
   Row │ Year   Month  Day    Sampling_date_order  plot   Species  Abundance  Presence  Latitude  Longitude  standardized_temperature  standardized_precipitation 
       │ Int64  Int64  Int64  Int64                Int64  String3  Int64      Int64     Float64   Float64    Float64                 Float64                  
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
     1 │  2010      1     16                    1      1  BA               0         0      35.0     -110.0                0.829467              -1.4024
     2 │  2010      1     16                    1      2  BA               0         0      35.0     -109.5               -1.12294               -0.0519895
     3 │  2010      1     16                    1      4  BA               0         0      35.0     -108.5               -0.409808              -0.803663
     4 │  2010      1     16                    1      8  BA               0         0      35.5     -109.5               -1.35913               -0.646369
     5 │  2010      1     16                    1      9  BA               0         0      35.5     -109.0                0.0822                 1.09485
   ⋮   │   ⋮      ⋮      ⋮             ⋮             ⋮       ⋮         ⋮         ⋮         ⋮          ⋮                ⋮                        ⋮
 53348 │  2023      3     21                  117      9  SH               0         0      35.5     -109.0               -0.571565              -0.836345
 53349 │  2023      3     21                  117     10  SH               0         0      35.5     -108.5               -2.33729               -0.398522
 53350 │  2023      3     21                  117     12  SH               1         1      35.5     -107.5                0.547169               1.03257
 53351 │  2023      3     21                  117     16  SH               0         0      36.0     -108.5               -0.815015               0.95971
 53352 │  2023      3     21                  117     23  SH               0         0      36.5     -108.0                0.48949               -1.59416
                                                                                                                                            53342 rows omitted

                                                                                          
julia> result = prop_patches(df.Presence, df.Species, df.plot)

julia> result.summary
1×3 DataFrame
 Row │ mean_prop_patches  min_prop_patches  max_prop_patches 
     │ Float64            Float64           Float64          
─────┼───────────────────────────────────────────────────────
   1 │          0.734649         0.0833333               1.0

julia> result.distribution
19×2 DataFrame
 Row │ Species  prop_patches 
     │ String3  Float64      
─────┼───────────────────────
   1 │ BA          1.0
   2 │ DM          1.0
   3 │ DO          0.791667
   4 │ DS          0.0833333
   5 │ NA          0.541667
  ⋮  │    ⋮          ⋮
  15 │ RF          0.166667
  16 │ RM          1.0
  17 │ RO          0.916667
  18 │ SF          0.833333
  19 │ SH          0.625
               9 rows omitted
source

References

  • Ehrlén, J., & Eriksson, O. (2000). Dispersal Limitation and Patchy Occupancy in Forest Herbs. Ecology, 81(6), 1667-1674. https://doi.org:https://doi.org/10.1890/0012-9658(2000)081[1667:DLAPOI]2.0.CO;2