From henr|k@bengt@@on @end|ng |rom gm@||@com  Mon Nov 18 05:42:32 2019
From: henr|k@bengt@@on @end|ng |rom gm@||@com (Henrik Bengtsson)
Date: Sun, 17 Nov 2019 20:42:32 -0800
Subject: [Rd] Suggestion: Make _R_CHECK_LENGTH_1_LOGIC2_=warn the default
 for R 3.6.2
Message-ID: <CAFDcVCR7DQbVFDeNum=7hdMzs7auF_g7+Y5SW16vYZCFJ3SEiw@mail.gmail.com>

Hi,

I'm not sure where we are in getting CRAN packages getting their
_R_CHECK_LENGTH_1_LOGIC2_=true bugs fixed (*), but maybe it'd help to
make _R_CHECK_LENGTH_1_LOGIC2_=warn the new default in the upcoming R
3.6.2? Warnings of type:

$ R --vanilla
> Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "warn")
> c(TRUE, FALSE) && TRUE
[1] TRUE
Warning message:
In c(TRUE, FALSE) && TRUE : 'length(x) = 2 > 1' in coercion to 'logical(1)'

could help encourage more package maintainers to fix these bugs
sooner. Enabling this warning by default is in line with what the
current default behavior for _R_CHECK_LENGTH_1_CONDITION_ bugs:

> if (c(TRUE, FALSE)) 42
[1] 42
Warning message:
In if (c(TRUE, FALSE)) 42 :
  the condition has length > 1 and only the first element will be used

which has been the case for many years.

Hopefully in a not too far future, we get to a point where we can have
_R_CHECK_LENGTH_1_LOGIC2_=true and _R_CHECK_LENGTH_1_CONDITION_=true
as the new defaults.

(*) I understand that CRAN incoming checks with
_R_CHECK_LENGTH_1_LOGIC2_=package:_R_CHECK_PACKAGE_NAME_,abort,verbose,
so all packages submitted to CRAN have to pass this check.  I don't
think Bioconductor checks for these yet, but I could be wrong.

/Henrik



[Rd] Suggestion: Make _R_CHECK_LENGTH_1_LOGIC2_=warn the default for R 3.6.2
Henrik Bengtsson