The clustering_clara function throws an error when a self-defined distance function is passed as metric argument. The error only occurs when the function is called with cores > 1 (i.e., in parallel mode) on Windows.
Probable mistake
The metric object is simply not exported to the cluster workers on Windows.
Solution
Add the metric object to the clusterExport function. Also do so for function clustering_clarans.
The
clustering_clara
function throws an error when a self-defined distance function is passed asmetric
argument. The error only occurs when the function is called withcores > 1
(i.e., in parallel mode) on Windows.Probable mistake The
metric
object is simply not exported to the cluster workers on Windows.Solution Add the
metric
object to theclusterExport
function. Also do so for functionclustering_clarans
.