hclust error related to NA/NaN/Inf in foreign function call

Hi, and welcome.

A reproducible example, called a reprex will elicit more precise answers. It doesn't have to be your actual data, just in same form. Otherwise, without knowing what csim contains, it's guesswork turtles all the way down and a pure google problem with the odd possibly helpful link? on offer.