You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
R-devel introduces as new features:
"Experimentally, setting environment variable _R_CHECK_LENGTH_1_LOGIC2_ will lead to warnings (or errors if the variable is set to a ‘true’ value) when && or || encounter and use arguments of length more than one. " (https://cran.r-project.org/doc/manuals/r-devel/NEWS.html)
The lintr function %||% will fail this upcoming check, e.g.,
Suggested fix: replace if (is.null(x) || is.na(x) || length(x) <= 0) {...
with if (is.null(x) || anyNA(x) || length(x) <= 0) {...
(anyNA was introduced in R v3.1.0 (https://cran.r-project.org/doc/manuals/r-release/NEWS.html) which is earlier than the lintr required R version 3.1.1).
The text was updated successfully, but these errors were encountered:
- `lintr` fails R-devel `_R_CHECK_LENGTH_1_LOGIC2_`, see r-lib/lintr#377
- temporarily disable `_R_CHECK_LENGTH_1_LOGIC2_` during our code style unit checks
--> revert this commit once `lintr` addressed r-lib/lintr#377
R-devel introduces as new features:
"Experimentally, setting environment variable
_R_CHECK_LENGTH_1_LOGIC2_
will lead to warnings (or errors if the variable is set to a ‘true’ value) when && or || encounter and use arguments of length more than one. " (https://cran.r-project.org/doc/manuals/r-devel/NEWS.html)The
lintr
function%||%
will fail this upcoming check, e.g.,with message
Expected result (as obtained with R v3.5.2):
Suggested fix: replace
if (is.null(x) || is.na(x) || length(x) <= 0) {...
with
if (is.null(x) || anyNA(x) || length(x) <= 0) {...
(
anyNA
was introduced in R v3.1.0 (https://cran.r-project.org/doc/manuals/r-release/NEWS.html) which is earlier than thelintr
required R version 3.1.1).The text was updated successfully, but these errors were encountered: