[Bioc-devel] New setting on devel builders will cause some new package failures

Shepherd, Lori Lor|@Shepherd @end|ng |rom Ro@we||P@rk@org
Fri Jan 24 14:57:42 CET 2020


Hello developers,

As a heads up notification,  we have enabled the check setting for _R_CHECK_LENGTH_1_LOGIC2_  on the main daily builders (this setting was already active for incoming submissions on the single package builder).  New ERROR's relating to this setting should be seen on the daily build reports either today or tomorrow.  Your packages may need adjustment to account for this setting.  This setting will catch logic ERROR similar to the following:

> Sys.setenv(`_R_CHECK_LENGTH_1_LOGIC2_`="true")
> c(TRUE, TRUE) && TRUE
Error in c(TRUE, TRUE) && TRUE :
  'length(x) = 2 > 1' in coercion to 'logical(1)'

Note:  The syntax ERROR in this case is using && which anticipates scalar comparison vs a vector comparison   (similar for ||  vs | )

> c(TRUE, TRUE) & TRUE
[1] TRUE TRUE


Also Note:

The logic check for conditionals greater than length one has been implemented since the beginning of the last release so the following are also caught but with _R_CHECK_LENGTH_1_CONDITION_  so technically the above solution would also be an ERROR if it was in a conditional.
> Sys.setenv(`_R_CHECK_LENGTH_1_CONDITION_`="true")
> Sys.setenv(`_R_CHECK_LENGTH_1_LOGIC2_`="true")
> if( c(TRUE, TRUE) && TRUE ) "yes"
Error in c(TRUE, TRUE) && TRUE :
  'length(x) = 2 > 1' in coercion to 'logical(1)'

> if( c(TRUE, TRUE) & TRUE ) "yes"
Error in if (c(TRUE, TRUE) & TRUE) "yes" : the condition has length > 1

# any and all could be useful in these cases
> if( all(c(TRUE, TRUE)) & TRUE ) "yes"
[1] "yes"


We made these changes as we have been notified by the R development team that the goal is to make these setting default in a near future version of R-devel.  We therefore are implementing now to allow maintainers to have as much notice as possible.


Cheers,


Lori Shepherd

Bioconductor Core Team

Roswell Park Comprehensive Cancer Center

Department of Biostatistics & Bioinformatics

Elm & Carlton Streets

Buffalo, New York 14263


This email message may contain legally privileged and/or confidential information.  If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited.  If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list