best function with warning  "NAs introduced by coercion"