https://stats-learn.com/en/r-learn/utility-whole-instances-in-r-with-examples/
Utility whole.instances in R (With Examples)