Passer au contenu

Prepares the Excel trial file by copying the blank template if self$excel_data_trial is missing or invalid. This ensures a valid Excel structure is available for inserting observation and metadata sheets.

Utilisation

prepare_excel_model(self, directory = NULL, filename = NULL)

Arguments

self

An instance of the UserData R6 class.

directory

Character. Directory where the new file should be saved. Defaults to the current working directory if NULL.

filename

Character. Name of the new Excel file (must end with .xlsx). If NULL, a default name based on the template is used.

Valeur de retour

None. The method updates self$excel_data_trial with the path to the copied file.

Détails

  • If self$excel_data_trial is already set and the file exists, nothing is done.

  • Otherwise, the method copies self$excel_model to the specified location and updates the reference in the object.

  • A message is printed to indicate success or failure.