Thank you for all answers!
I agree that adopting a testing framework would be a better approach
for future packages. However, as this particular package is not under
active development, I was particularly looking for solutions that
required less modifications of the current code.
And from the answ
I would emphasize/paraphrase Ivan's point -- using goldens (.Rout.save) for
such tests is quite a headache. We do so for a very limited number of tests
in {data.table} (something like 10 tests of over 10,000).
You could instead change the tests of Suggests behavior to be based on
expectations, be
Am 31.07.25 um 11:09 schrieb Jon Olav Skoien:
Is there a different way of conditionally
using the suggested package? Or do I have to use the IGNORE_RDIFF
method?
To use *reference output* for optional tests, you could move these tests
to a dedicated script with a corresponding .Rout.save file,
To check the existence of a suggested package it is recommended to use
requireNamespace("suggested", quiet = TRUE). See the solution for
examples on the CRAN cookbook [1].
On tests, it depends on the approach you use.
It seems that you don't use any testing package for it (tinytest,
testthat, ...)
В Thu, 31 Jul 2025 11:09:39 +0200
Jon Olav Skoien пишет:
> From what I understood, a solution is to wrap this part of the code
> inside if (require("suggestedPackage")) {useSuggestedPackage}
Correct! (requireNamespace(...) is also a good option if you don't
intend to use the package directly and
Greg,
If the problem is in your local checks you can
add _R_CHECK_SYSTEM_CLOCK_=FALSE to your .Renviron to omit that check.
See R internals (which documents CRAN's default too) [1].
Best,
Lluís
[1]:
https://cran.r-project.org/doc/manuals/r-devel/R-ints.html#index-_005fR_005fCHECK_005fSYSTEM_00
One of my packages failed the noSuggests test, and needs to be
updated. Fair enough, a suggested package was used unconditionally
both in an example and in a test. From what I understood, a solution
is to wrap this part of the code inside
if (require("suggestedPackage")) {useSuggestedPackage}
Howev