Estimates abundance by counting number of occurrence per site.

countOcc(dmat)

Arguments

dmat

A distance matrix as generated by 'pointSample' or 'transectSample'.

Details

Value

Returns a data frame with count values per site.

References

Author

Note

See also

Examples

set.seed(1234)

#Generate ocurrence points
occ <- data.frame(x = runif(500, 0, 100), y = runif(500, 0, 100))
#Generate sampling units
sites <- uniformSamp(c(0, 100), c(0, 100), 25)

plot(occ)
points(sites, col = "red", pch = 19)


#Get the distance matrix from a point sampling procedure with the ecoforge::pointSample() function
psamp <- pointSample(sites, occ, radius = 10)

#Count occurrences detected per sampling unit
counts <- countOcc(psamp$distance)
head(counts)
#>   site_ID count
#> 1       1    15
#> 2       2    17
#> 3       3    13
#> 4       4    11
#> 5       5    19
#> 6       6    22
barplot(counts$count, names.arg = counts$site_ID,
        xlab = "Site ID", ylab = "Count",
        main = "Detections per sampling site")