0

I am using a library which calls the function to a dendrogram object dend

positiveheights = function(x){
    if (attributes(x)$height < 0) {
        attributes(x)$height = 0.0001
    }
    x
}

dend = dendrapply(dend, positiveheights)

This returns

Error: C stack usage 15944436 is too close to the limit

> dend
'dendrogram' with 2 branches and 2039 members total, at height 10.01118

I'm aware of a previous question which had this issue, which was caused by infinite recursion when the nodes where not being returned from the function. However, that doesn't seem to be the cause here since the function returns the node x.

What might be causing this issue?

user438383
  • 5,716
  • 8
  • 28
  • 43
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Mar 30 '23 at 18:25
  • @MrFlick you're right, just trying to figure out how to make a minimal example of this dendrogram object. – user438383 Mar 31 '23 at 09:10

0 Answers0