Question: Write a function `find_closest
Write a function `find_closest <- function(y, centers) {}` where
- `y` is a numeric vector,
- `centers` is a list of numeric vectors, each of them having the same length as `y`. The function should return an integer corresponding to the member of the `centers` list that is the __closest__ to `y` according to the mean squared differences.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
