This is great news. For those who wish to reproduce this locally when running R CMD check, I suggest creating '~/.R/check.Renviron' with:
## Check for bugs like if (c(TRUE, FALSE)) ... Supported since R 3.4.0 _R_CHECK_LENGTH_1_CONDITION_=package:_R_CHECK_PACKAGE_NAME_,verbose ## Check for bugs like c(TRUE, FALSE) && TRUE. Supported since R 3.6.0 _R_CHECK_LENGTH_1_LOGIC2_=package:_R_CHECK_PACKAGE_NAME_,verbose These environment variables will be applied only when running 'R CMD check'. The 'package:_R_CHECK_PACKAGE_NAME_' part makes sure these bugs trigger check ERRORs only on the package being tested, i.e. you can check for these bugs in your package also when one of your dependencies have this bug. If you want to detect these errors when you run R in general, e.g. in your analysis, you can add: _R_CHECK_LENGTH_1_CONDITION_=${_R_CHECK_LENGTH_1_CONDITION_-verbose} _R_CHECK_LENGTH_1_LOGIC2_=${_R_CHECK_LENGTH_1_LOGIC2_-verbose} to your ~/.Renviron. This will trigger a run-time error whenever and wherever this bug occurs. If you prefer to get warnings instead of errors, use 'warn,verbose' instead of 'verbose'. If you find these mistakes in other packages, please consider taking the time to report the maintainer. /Henrik On Fri, Jan 24, 2020 at 6:07 AM Shepherd, Lori <lori.sheph...@roswellpark.org> wrote: > > 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]] > > _______________________________________________ > Bioc-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/bioc-devel _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel