Passer au contenu

Saves the provided combined observation data into the "data" sheet of a versioned Excel file. The function creates a copy of the original Excel file with an incremented suffix (e.g., _v1, _v2, etc.) to avoid overwriting existing files.

Utilisation

save_data_to_excel(combined_data, excel_data_trial_path)

Arguments

combined_data

A data.frame containing the combined observation data to write into the Excel file.

excel_data_trial_path

Character. Full path to the original Excel file to use as a base for creating the versioned copy.

Valeur de retour

A character string containing the full path of the newly saved versioned Excel file.

Détails

  • The original Excel file is not modified.

  • If a "data" sheet exists in the versioned file, it is replaced with the new data.

  • The function returns the path of the versioned file, which includes _v1, _v2, etc., to ensure uniqueness.