Feeding R agnes object into cutree
I found an answer in a related post here. Another user was getting a similar error about ordering height, but theirs came with the suggestion to apply as.hclust() first. I converted the agnes object to an hclust and passed that directly into cutree. That seemed to solve the problem.