Skip to content

Commit

Permalink
#4353: tweak to pass R 3.1 where is.na(NULL) issued a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdowle committed Aug 23, 2021
1 parent 30b6f0e commit 897ac6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ replace_dot_alias = function(e) {
missingnomatch = missing(nomatch)
nomatch0 = identical(nomatch,0) || identical(nomatch,0L) # for warning with row-numbers in i; #4353
if (nomatch0) nomatch=NULL # retain nomatch=0 backwards compatibility; #857
if (!is.na(nomatch) && !is.null(nomatch)) stopf("nomatch= must be either NA or NULL (or 0 for backwards compatibility which is the same as NULL but please use NULL)")
if (!(is.null(nomatch) || (length(nomatch)==1L && is.na(nomatch)))) stopf("nomatch= must be either NA or NULL (or 0 for backwards compatibility which is the same as NULL but please use NULL)")
if (!is.logical(which) || length(which)>1L) stopf("which= must be a logical vector length 1. Either FALSE, TRUE or NA.")
if ((isTRUE(which)||is.na(which)) && !missing(j)) stopf("which==%s (meaning return row numbers) but j is also supplied. Either you need row numbers or the result of j, but only one type of result can be returned.", which)
if (is.null(nomatch) && is.na(which)) stopf("which=NA with nomatch=0|NULL would always return an empty vector. Please change or remove either which or nomatch.")
Expand Down

0 comments on commit 897ac6d

Please sign in to comment.