Skip to content
Prev 318395 / 398502 Next

cutreeDynamic error

On Tue, Feb 26, 2013 at 8:34 AM, Joanna Papakonstantinou
<joanna.papa at gmail.com> wrote:
Yes, leave out the 'deepSplit = (ifelse(method=="hybrid", 1, FALSE))'
from the call. This is not really a cutreeDynamic problem, it is a
perhaps somewhat confusing aspect of R language. If you don't specify
deepSplit, its default value will be evaluated within the function
'interior' where the variable 'method' is defined. If you do specify
deepSplit, the expression that you specify is evaluated from 'outside'
the function where the variable 'method' is undefined. Thus, the
seemingly same expression can lead to two different results.

In fact, you may want to leave out all arguments for which you are
using a default value, it will make your call shorter and less prone
to the type of error you just experienced.

HTH,

Peter