Henrik Bengtsson
2008-Jul-20 18:34 UTC
[Rd] R CMD check test examples with and without Suggest installed
Hi, is there a way to have R CMD check test the example():s twice, once with all Suggest package hidden or once, if $R_check_force_suggests=1, with all Suggest available? BACKGROUND: I just had a case where my R.matlab package passed all R CMD checks on my local machine, but when I uploaded it to CRAN it gave an error there. R.matlab has Omegahat's 'Rcompression' package listed under Suggest: in DESCRIPTION. I've put it there, because it is optional. The example(readMat) scans an inst/ directory for *.mat files and asserts that they can be read. One of them required 'Rcompression', which is not installed by the CRAN servers. I can of course correct this example code to work both with and without 'Rcompression' installed. But my question is, how can I have R CMD check test the two cases where optional packages are installed or not, so I can catch these errors? The best solution I found was to set $R_check_force_suggests=0 in $HOME/.R/check.conf and uninstall (or otherwise hide) the Suggest:ed packages. Cheers Henrik