Skip to contents

Reads the nightly detection history written by calibrate() and writes the matrices of community_matrices() to output_dir: frequency_matrix_site_month_k<k>.csv, count_matrix_site_month_k<k>.csv and effort_site_month.csv (which also lists the dropped cells). This is the function form of the v1.2.0 script gerar_matrizes_comunidade.R.

Usage

build_community_matrices(
  history_file,
  output_dir,
  core_species,
  k_min = 2,
  min_nights_month = 5
)

Arguments

history_file

Path to nightly_detection_history.csv (or a v1.2.0 historico_deteccao_noite.csv).

output_dir

Output folder; created if needed.

core_species

Species codes (the species column) that enter the matrix.

k_min

Repetition rule: 1, 2 or 3 reliable detections on the night.

min_nights_month

Site x month cells with fewer recorded nights are dropped from the matrices (unstable frequencies) and flagged in effort.

Value

The list returned by community_matrices(), invisibly.