Description Usage Arguments Details Value Examples
%notin%
tells you which values of vector x are not in vector y.
1 | x %notin% y
|
x |
A vector |
y |
A vector |
Although this function can be called as `%notin%`(x, y)
, the intended use is like the function %in%
: similar to x %in% y
, this function's supposed use is x %notin% y
.
Vector types (more formally: modes) don't need to match (see last example).
A vector of of booleans with the length of vector x. TRUE
indicates that the particular element of x is not in y, FALSE
indicates that the element of x is in y.
1 2 3 4 5 6 7 8 9 10 | c(1,2,3) %notin% c(0,2,4) # returns TRUE FALSE TRUE
# compare to:
c(1,2,3) %in% c(0,2,4) # returns FALSE TRUE FALSE
c(1,2) %notin% c(0,2,4) # returns TRUE FALSE
# versus (vectors changed place, hence, result adapts to length of x):
c(0,2,4) %notin% c(1,2) # returns TRUE FALSE TRUE
c('Hello', 'world') %notin% unlist(strsplit('The world is not enough', ' ')) # TRUE FALSE
c('Hello', 'world') %notin% c(1,2,3,4,5) # returns TRUE TRUE. Vector types don't need to match.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.