This function add new eDNA data to previous ones.
spygen_new_data_function(old_spygen_data_path, new_spygen_data_path, path_save)A character indicating the path of spygen old data (cleaned). Data has to be in the format ".csv".
A character indicating the path of spygen new raw data. Data has to be in the format ".xlsx".
A character indicating the path to save data.
Save new data to path_save.
The function first convert new raw species data to site X species matrix using the 'convert_to_matrix_function' and then check for correct species names using the 'species_clean_function'.
The function then look for common spygen code between old and new data, potentially resulting from reanalysis from Spygen (update of reference data base).
If no common spygen code are detected, the function join the new data to the old ones.
Otherwise, once identified, the function look at differences between old and new data.
If no difference detected, the function join the new data to the old ones with no changes in common data.
If differences have been detected, the function will replace the old data with new data.