mk_voucher_dirs

Organize voucher image directories by updated identification
forplotR::mk_voucher_dirs()

Description

Organizes image folders of voucher specimens based on their updated taxonomic identification provided in Forestplots format template. It is designed to be safely rerun multiple times, adapting its behavior depending on the existing directory structure.On the first execution, the function will read the voucher information from the Forestplots standardized file, (i) create a main folder (default: "voucher_imgs"), if it does not already exist.(ii) For each voucher marked as “Collected”, it will create a directory structure following the format Family/Genus/Voucher to receive the corresponding images. On subsequent executions, the function performs a reorganization: identifies and compares existing folders that may have outdated or incorrect genus assignments. If it finds that a voucher is in the wrong genus folder (e.g., due to taxonomic reidentification),it moves the images to the correct folder. In case the correct folder already contains images, the function avoids overwriting and keeps the content intact.Once images are moved (or verified), the function deletes any empty,outdated voucher directories.This ensures that the directory structure always reflects the most up-to-date taxonomic information, making image organization robust, repeatable, and easy to maintain.

Arguments

Argument Description
fp_file_path Character. Path to the Excel file containing voucher data.
output_dir Character. Directory to organize the voucher image folders. Default is “voucher_imgs”.

Examples

mk_voucher_dirs(fp_file_path = "data/RUS_plot.xlsx",
                         output_dir = "voucher_imgs")