Results habitat association
Usage
results_habitat_association(
pattern,
raster,
significance_level = 0.05,
breaks = NULL,
digits = NULL,
verbose = TRUE
)
Arguments
- pattern
ppp object with original point pattern data or rd_pat or rd_mar object with randomized point pattern.
- raster
SpatRaster with original discrete habitat data or rd_ras object with randomized environmental data.
- significance_level
Double with significance level.
- breaks
Vector with breaks of habitat classes.
- digits
Integer with digits used during rounding.
- verbose
Logical if messages should be printed.
Details
The functions shows significant habitat associations by comparing the number of points within a habitat between the observed data and randomized data as described in Plotkin et al. (2000) and Harms et al. (2001). Significant positive or associations are present if the observed count in a habitat is above or below a certain threshold of the randomized count, respectively.
In case the SpatRaster contains NA cells, this needs to be reflected in the observation window of the point pattern as well (i.e., no point locations possible in these areas).
If breaks = NULL
(default), only habitat labels (but not breaks) will be
returned. If a vector with breaks
is provided (same order as increasing habitat values),
the breaks will be included as well.
References
Harms, K.E., Condit, R., Hubbell, S.P., Foster, R.B., 2001. Habitat associations of trees and shrubs in a 50-ha neotropical forest plot. Journal of Ecology 89, 947–959. <https://doi.org/10.1111/j.1365-2745.2001.00615.x>
Plotkin, J.B., Potts, M.D., Leslie, N., Manokaran, N., LaFrankie, J.V., Ashton, P.S., 2000. Species-area curves, spatial aggregation, and habitat specialization in tropical forests. Journal of Theoretical Biology 207, 81–99. <https://doi.org/10.1006/jtbi.2000.2158>
Examples
landscape_classified <- classify_habitats(terra::rast(landscape), n = 5, style = "fisher")
species_a_random <- fit_point_process(species_a, n_random = 199)
#> Unmarking provided input pattern.
#>
> Progress: n_random: 1/199
#>
> Progress: n_random: 2/199
#>
> Progress: n_random: 3/199
#>
> Progress: n_random: 4/199
#>
> Progress: n_random: 5/199
#>
> Progress: n_random: 6/199
#>
> Progress: n_random: 7/199
#>
> Progress: n_random: 8/199
#>
> Progress: n_random: 9/199
#>
> Progress: n_random: 10/199
#>
> Progress: n_random: 11/199
#>
> Progress: n_random: 12/199
#>
> Progress: n_random: 13/199
#>
> Progress: n_random: 14/199
#>
> Progress: n_random: 15/199
#>
> Progress: n_random: 16/199
#>
> Progress: n_random: 17/199
#>
> Progress: n_random: 18/199
#>
> Progress: n_random: 19/199
#>
> Progress: n_random: 20/199
#>
> Progress: n_random: 21/199
#>
> Progress: n_random: 22/199
#>
> Progress: n_random: 23/199
#>
> Progress: n_random: 24/199
#>
> Progress: n_random: 25/199
#>
> Progress: n_random: 26/199
#>
> Progress: n_random: 27/199
#>
> Progress: n_random: 28/199
#>
> Progress: n_random: 29/199
#>
> Progress: n_random: 30/199
#>
> Progress: n_random: 31/199
#>
> Progress: n_random: 32/199
#>
> Progress: n_random: 33/199
#>
> Progress: n_random: 34/199
#>
> Progress: n_random: 35/199
#>
> Progress: n_random: 36/199
#>
> Progress: n_random: 37/199
#>
> Progress: n_random: 38/199
#>
> Progress: n_random: 39/199
#>
> Progress: n_random: 40/199
#>
> Progress: n_random: 41/199
#>
> Progress: n_random: 42/199
#>
> Progress: n_random: 43/199
#>
> Progress: n_random: 44/199
#>
> Progress: n_random: 45/199
#>
> Progress: n_random: 46/199
#>
> Progress: n_random: 47/199
#>
> Progress: n_random: 48/199
#>
> Progress: n_random: 49/199
#>
> Progress: n_random: 50/199
#>
> Progress: n_random: 51/199
#>
> Progress: n_random: 52/199
#>
> Progress: n_random: 53/199
#>
> Progress: n_random: 54/199
#>
> Progress: n_random: 55/199
#>
> Progress: n_random: 56/199
#>
> Progress: n_random: 57/199
#>
> Progress: n_random: 58/199
#>
> Progress: n_random: 59/199
#>
> Progress: n_random: 60/199
#>
> Progress: n_random: 61/199
#>
> Progress: n_random: 62/199
#>
> Progress: n_random: 63/199
#>
> Progress: n_random: 64/199
#>
> Progress: n_random: 65/199
#>
> Progress: n_random: 66/199
#>
> Progress: n_random: 67/199
#>
> Progress: n_random: 68/199
#>
> Progress: n_random: 69/199
#>
> Progress: n_random: 70/199
#>
> Progress: n_random: 71/199
#>
> Progress: n_random: 72/199
#>
> Progress: n_random: 73/199
#>
> Progress: n_random: 74/199
#>
> Progress: n_random: 75/199
#>
> Progress: n_random: 76/199
#>
> Progress: n_random: 77/199
#>
> Progress: n_random: 78/199
#>
> Progress: n_random: 79/199
#>
> Progress: n_random: 80/199
#>
> Progress: n_random: 81/199
#>
> Progress: n_random: 82/199
#>
> Progress: n_random: 83/199
#>
> Progress: n_random: 84/199
#>
> Progress: n_random: 85/199
#>
> Progress: n_random: 86/199
#>
> Progress: n_random: 87/199
#>
> Progress: n_random: 88/199
#>
> Progress: n_random: 89/199
#>
> Progress: n_random: 90/199
#>
> Progress: n_random: 91/199
#>
> Progress: n_random: 92/199
#>
> Progress: n_random: 93/199
#>
> Progress: n_random: 94/199
#>
> Progress: n_random: 95/199
#>
> Progress: n_random: 96/199
#>
> Progress: n_random: 97/199
#>
> Progress: n_random: 98/199
#>
> Progress: n_random: 99/199
#>
> Progress: n_random: 100/199
#>
> Progress: n_random: 101/199
#>
> Progress: n_random: 102/199
#>
> Progress: n_random: 103/199
#>
> Progress: n_random: 104/199
#>
> Progress: n_random: 105/199
#>
> Progress: n_random: 106/199
#>
> Progress: n_random: 107/199
#>
> Progress: n_random: 108/199
#>
> Progress: n_random: 109/199
#>
> Progress: n_random: 110/199
#>
> Progress: n_random: 111/199
#>
> Progress: n_random: 112/199
#>
> Progress: n_random: 113/199
#>
> Progress: n_random: 114/199
#>
> Progress: n_random: 115/199
#>
> Progress: n_random: 116/199
#>
> Progress: n_random: 117/199
#>
> Progress: n_random: 118/199
#>
> Progress: n_random: 119/199
#>
> Progress: n_random: 120/199
#>
> Progress: n_random: 121/199
#>
> Progress: n_random: 122/199
#>
> Progress: n_random: 123/199
#>
> Progress: n_random: 124/199
#>
> Progress: n_random: 125/199
#>
> Progress: n_random: 126/199
#>
> Progress: n_random: 127/199
#>
> Progress: n_random: 128/199
#>
> Progress: n_random: 129/199
#>
> Progress: n_random: 130/199
#>
> Progress: n_random: 131/199
#>
> Progress: n_random: 132/199
#>
> Progress: n_random: 133/199
#>
> Progress: n_random: 134/199
#>
> Progress: n_random: 135/199
#>
> Progress: n_random: 136/199
#>
> Progress: n_random: 137/199
#>
> Progress: n_random: 138/199
#>
> Progress: n_random: 139/199
#>
> Progress: n_random: 140/199
#>
> Progress: n_random: 141/199
#>
> Progress: n_random: 142/199
#>
> Progress: n_random: 143/199
#>
> Progress: n_random: 144/199
#>
> Progress: n_random: 145/199
#>
> Progress: n_random: 146/199
#>
> Progress: n_random: 147/199
#>
> Progress: n_random: 148/199
#>
> Progress: n_random: 149/199
#>
> Progress: n_random: 150/199
#>
> Progress: n_random: 151/199
#>
> Progress: n_random: 152/199
#>
> Progress: n_random: 153/199
#>
> Progress: n_random: 154/199
#>
> Progress: n_random: 155/199
#>
> Progress: n_random: 156/199
#>
> Progress: n_random: 157/199
#>
> Progress: n_random: 158/199
#>
> Progress: n_random: 159/199
#>
> Progress: n_random: 160/199
#>
> Progress: n_random: 161/199
#>
> Progress: n_random: 162/199
#>
> Progress: n_random: 163/199
#>
> Progress: n_random: 164/199
#>
> Progress: n_random: 165/199
#>
> Progress: n_random: 166/199
#>
> Progress: n_random: 167/199
#>
> Progress: n_random: 168/199
#>
> Progress: n_random: 169/199
#>
> Progress: n_random: 170/199
#>
> Progress: n_random: 171/199
#>
> Progress: n_random: 172/199
#>
> Progress: n_random: 173/199
#>
> Progress: n_random: 174/199
#>
> Progress: n_random: 175/199
#>
> Progress: n_random: 176/199
#>
> Progress: n_random: 177/199
#>
> Progress: n_random: 178/199
#>
> Progress: n_random: 179/199
#>
> Progress: n_random: 180/199
#>
> Progress: n_random: 181/199
#>
> Progress: n_random: 182/199
#>
> Progress: n_random: 183/199
#>
> Progress: n_random: 184/199
#>
> Progress: n_random: 185/199
#>
> Progress: n_random: 186/199
#>
> Progress: n_random: 187/199
#>
> Progress: n_random: 188/199
#>
> Progress: n_random: 189/199
#>
> Progress: n_random: 190/199
#>
> Progress: n_random: 191/199
#>
> Progress: n_random: 192/199
#>
> Progress: n_random: 193/199
#>
> Progress: n_random: 194/199
#>
> Progress: n_random: 195/199
#>
> Progress: n_random: 196/199
#>
> Progress: n_random: 197/199
#>
> Progress: n_random: 198/199
#>
> Progress: n_random: 199/199
#>
results_habitat_association(pattern = species_a_random, raster = landscape_classified)
#> > Input: randomized pattern
#> > Quantile thresholds: negative < 0.025 || positive > 0.975
#> habitat breaks count lo hi significance
#> 1 1 NA 35 12.00 26 positive
#> 2 2 NA 44 25.00 44 n.s.
#> 3 3 NA 36 22.95 41 n.s.
#> 4 4 NA 4 29.00 52 negative
#> 5 5 NA 73 54.00 80 n.s.