Title: | Clustering Observations from Breeding Birds into Territoria |
---|---|
Description: | Clusters individual observations based on breeding indication and distance between observations. |
Authors: | Thierry Onkelinx [aut, cre] (<https://orcid.org/0000-0001-8804-4216>, Research Institute for Nature and Forest (INBO)), Research Institute for Nature and Forest (INBO) [cph, fnd] |
Maintainer: | Thierry Onkelinx <[email protected]> |
License: | GPL-3 |
Version: | 0.0.3 |
Built: | 2024-11-09 02:51:26 UTC |
Source: | https://github.com/inbo/territoria |
Cluster observations
cluster_observation(conn, status, max_dist = 336, reset = FALSE)
cluster_observation(conn, status, max_dist = 336, reset = FALSE)
conn |
a DBI connection to an SQLite database. |
status |
highest status to include while clustering the observations. |
max_dist |
maximum clustering distance in m. |
reset |
reset the current clustering.
Defaults to |
Connect to a database
connect_db(db = ":memory:")
connect_db(db = ":memory:")
db |
The file name of the database |
Calculate the distance matrix
distance_matrix(conn, max_dist = 336)
distance_matrix(conn, max_dist = 336)
conn |
a DBI connection to an SQLite database. |
max_dist |
maximum clustering distance in m. |
Get the information from the clusters
get_cluster(conn)
get_cluster(conn)
conn |
a DBI connection to an SQLite database. |
The function overwrites any existing table with observations.
import_observations(observations, conn, max_dist = 336)
import_observations(observations, conn, max_dist = 336)
observations |
a data.frame with the observations. |
conn |
a DBI connection to an SQLite database. |
max_dist |
maximum clustering distance in m. |
Simulate a dataset in a square area
simulate_observations( density = 1e-05, area = 4e+06, gamma = 0.5, max_dist = 336, n_survey = 4, p_detection = 0.6, status_distribution = c(0.2, 0.5, 0.3) )
simulate_observations( density = 1e-05, area = 4e+06, gamma = 0.5, max_dist = 336, n_survey = 4, p_detection = 0.6, status_distribution = c(0.2, 0.5, 0.3) )
density |
Density as the number of territoria per m². |
area |
Area in which to simulate territoria in m². |
gamma |
interaction parameter of the Strauss process.
See |
max_dist |
maximum clustering distance in m. |
n_survey |
Number of surveys. |
p_detection |
Probability of detection within a survey. |
status_distribution |
a weighting vector for statuses. The order of the vector is the number of the status. |