For information on using this system, please visit this page.

Bug 16430 - cluster::daisy bug in error reporting
Summary: cluster::daisy bug in error reporting
Status: CLOSED FIXED
Alias: None
Product: R
Classification: Unclassified
Component: Add-ons (show other bugs)
Version: R 3.1.3
Hardware: All Windows 64-bit
: P5 trivial
Assignee: R-core
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-17 08:33 UTC by Nico Verwer
Modified: 2015-06-18 08:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Verwer 2015-06-17 08:33:09 UTC
In the daisy function, there is a check for 'bad' column types:

    if (any(ina <- is.na(type3))) 
        stop(gettextf("invalid type %s for column numbers %s", 
            type2[ina], pColl(which(is.na))))

When such an error is found, the body of the `if` is executed, which causes R to complain about `which(is.na)` because `is.na` is not a logical.

The above code should be:

    if (any(ina <- is.na(type3))) 
        stop(gettextf("invalid type %s for column numbers %s", 
            type2[ina], pColl(which(ina))))


This will fix the bug and report type errors as intended.
Comment 1 Martin Maechler 2015-06-17 10:34:50 UTC
Thank you, Nico, for this report.... indeed 'trivial' in so far as it only triggers in case of a user error..
..
but of course you are 100% correct.


One last remark: Formally it is wrong to report bugs about recommended packages with a non-R-core maintainer here.

maintainer("cluster") 

would have told you implicitly to report the bug to me only.

Of course, this is no longer necessary now.

Thanks again,
Martin