Re: [Rd] Unnecessary note when import only used in arg definition

2023-02-06 Thread Duncan Murdoch
On 06/02/2023 2:31 p.m., Duncan Murdoch wrote: On 06/02/2023 1:59 p.m., Duncan Murdoch wrote: I think the usual rule is that a qualified use of a package is sufficient to suppress the warning without any entry in the NAMESPACE file. So if there isn't something else going on, Antoine's example i

Re: [Rd] Unnecessary note when import only used in arg definition

2023-02-06 Thread Duncan Murdoch
On 06/02/2023 1:59 p.m., Duncan Murdoch wrote: I think the usual rule is that a qualified use of a package is sufficient to suppress the warning without any entry in the NAMESPACE file. So if there isn't something else going on, Antoine's example illustrates a bug (or at least an inconsistency)

Re: [Rd] Unnecessary note when import only used in arg definition

2023-02-06 Thread Duncan Murdoch
I think the usual rule is that a qualified use of a package is sufficient to suppress the warning without any entry in the NAMESPACE file. So if there isn't something else going on, Antoine's example illustrates a bug (or at least an inconsistency) in the check code. Here's a version of your

Re: [Rd] Unnecessary note when import only used in arg definition

2023-02-06 Thread Kevin Ushey
Hi Antoine, Maybe I'm misunderstanding, but I think the warning is saying that you've declared the package dependency in the DESCRIPTION file, but you haven't actually imported the package (or any functions) in your package NAMESPACE file? I put together an example package that I think satisfies

[Rd] Unnecessary note when import only used in arg definition

2023-02-06 Thread Antoine Fabri
Dear r-devel, When a package is only used in an argument definition, e.g : f <- function(test = testthat::is_testing()) { if (test) 1 else 2 } R CMD CHECK gives us a note: "Namespace in Imports field not imported from: 'testthat'" This incites me to remove the package from the Imports fi