From hb at stat.berkeley.edu  Sun Jul 20 20:34:30 2008
From: hb at stat.berkeley.edu (Henrik Bengtsson)
Date: Sun, 20 Jul 2008 11:34:30 -0700
Subject: [Rd] R CMD check test examples with and without Suggest installed
Message-ID: <59d7961d0807201134m28959230ne9212d3b30fc4c7c@mail.gmail.com>

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



[Rd] R CMD check test examples with and without Suggest installed
Henrik Bengtsson