Wishlist-for-R icon indicating copy to clipboard operation
Wishlist-for-R copied to clipboard

WISH: More details on where partial names / argument matches originate from

Open HenrikBengtsson opened this issue 6 years ago • 3 comments

Example of a partial name match from running one of the caret examples:

Warning: partial match of 'param' to 'parameters'
Warning in method$param : partial match of 'param' to 'parameters'

I have no clue where this originate from because there are many nested package calls. Sure, I could set options(warn = 2L) to bump up the warning to an error - then traceback() would reveal where the problem is. But, it would be neat if the warning message itself mentions at least in which namespace this occurs.

HenrikBengtsson avatar Apr 28 '18 03:04 HenrikBengtsson

You can create an in-place handler for the warning, that saves the stack.

gaborcsardi avatar Apr 28 '18 07:04 gaborcsardi

Yes, something that would work in interactive mode. Ideally I'd like to tweak the warnings on-the-fly for both interactive and batch. Here's another example I just bumped into while install a big software stack - is that warning due to xml2 or something else?

Exports.o connection.o xml2_doc.o xml2_init.o xml2_namespace.o xml2_node.o xml2_output.o xml2_schema.o xml2_url.o xml2_xpath.o -lxml2 -L/usr/lib/R/lib -lR
installing to /home/hb/R/x86_64-pc-linux-gnu-library/3.5/xml2/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
Warning in attr(x, "description") :
  partial match of 'description' to 'descriptions'
Warning in attr(x, "description") :
  partial match of 'description' to 'descriptions'
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (xml2)

HenrikBengtsson avatar Apr 28 '18 21:04 HenrikBengtsson

I use

options(warnPartialMatchAttr   = TRUE,
        warnPartialMatchDollar = TRUE,
        warnPartialMatchArgs   = TRUE,
	showWarnCalls          = TRUE)

where showWarnCalls = TRUE gives details of the warning's origin. Is that what you are looking for?

ghost avatar Sep 06 '18 08:09 ghost