I have a function that takes a call xm, where xm is a learnt machine learning model. Is there a way tht within the function I can print the name of xm rather than the summary of the model which is what happens when you print(xm)
For example, my function generates graphs that I am saving within the function
modsummary <- function(xm){
mypath <- file.path("C:","Users","Documents",paste("rf_fit_hmeas_random", ".png", sep = ""))
png(file = mypath)
print(plot(xm))
dev.off()
}
modsummary(rf_fit)
What I am trying to do is set this up in way so that it will paste xm (in this case rf_fit) so that it automatically detecs the function called and replaces xm_hmeas_random each time a different model is called.
Thank you