The error message is telling you that DM_data contains nothing and it should be a data frame, you should start by checking on that.
If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.
The error message is telling you that DM_data contains nothing and it should be a data frame, you should start by checking on that.
If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.