This function verifies that a given data frame is compliant to a POM export, that means it contains all required columns. If any required column is missing, it stops execution and provides a clear error message listing missing and present columns. If all required columns are present, it returns TRUE and prints a confirmation message.
Utilisation
check_pom_csv(filepath, required = c("DATE", "PLUIE"))Valeur de retour
Returns TRUE if the csv file is compliant (csv and all required columns presents), else stops execution
with an error message.
Détails
The function first checks if
filepathis indeed a csv file.It then compares the names of
filepathto therequiredcolumns.If any columns are missing, an informative error is thrown listing missing and available columns.
If all required columns are present, a message is displayed confirming their presence.
