В Thu, 24 Jul 2025 15:15:35 +0000
Mark Clements <mark.cleme...@ki.se> пишет:

> I am looking for guidance on how to debug a CRAN warning for a
> package (rstpm2). The warning is:
> 
> `Warning in formals(fun) : argument is not a function`

Could you please provide some more information on where you encounter
it and how it may be reproduced? I don't see it mentioned at
<https://cran.r-project.org/web/checks/check_results_rstpm2.html>, nor
I see a recent incoming_pretest failure, but I do see some problems
regarding constants being overwritten at
<https://github.com/kalibera/cran-checks/tree/master/rcnst/results/rstpm2>.
It's not impossible that the root cause of this warning is the same
(although it's also plausible that it's different).

> At package installation, this showed that some formals() were called
> with objects of class derivedDefaultMethod -- however I am not
> certain _which_ objects cause this issue.

I think this is a red herring: a derivedDefaultMethod is a function and
doesn't cause this warning by itself:

getClass('derivedDefaultMethod') |> new(\(foo=bar) baz) |> formals()
# $foo
# bar

> Does anyone have experience with debugging such warnings?

If you can reproduce the warning, try doing so with options(warn = 2,
error = recover) set.

-- 
Best regards,
Ivan

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to