Combines two separate Rveg databases into a single, unified database.
This function cleanly merges both the species composition data (REL) and the
environmental plot header data (HEAD), and seamlessly combines their metadata.
Writes two linked CSV files to the location specified by export, representing
the combined Rveg database.
Arguments
database_1
Character. The path and name of the first Rveg database (e.g., "path/to/db1").
database_2
Character. The path and name of the second Rveg database (e.g., "path/to/db2").
export
Character. The output path and name where the merged database files
(*HEAD.csv and *REL.csv) will be saved. Defaults to a temporary directory.
Details
During the merge process:
Relevé Re-indexing: The relevé columns from both databases are sequentially re-indexed (e.g., X1, X2, ..., Xn) to prevent column name collisions.
Checklist Validation: The function checks the metadata of both databases to ensure they were built using the same species checklist. If the checklists differ, it will issue a warning, though the merge will still proceed.
Missing Species: If a species exists in one database but not the other, the function automatically fills the absences with 0.
Metadata: The total number of relevés is updated, and any custom species (extra_spec) from both databases are concatenated together.
See Also
RvegCombine for manipulating data within a single database, addReleve for adding individual relevés.