operators | R Documentation |
Extensions of base operators.
inverse of %in%
x %notin% vector x %allin% vector x %anyin% vector x %nonein% vector pattern %partin% vector
x |
Numeric or character vector. |
vector |
Numeric or character vector. |
pattern |
Character string containing regular expressions to be matched. |
logical
logical
base::any()
, base::match()
, and base::all()
base::grepl()
data <- data.frame( id = 1:10, x = as.integer(runif(10, 0, 10)) ) data[data$id %notin% c(1, 3, 5, 7, 9), ] 1:2 %allin% 1:3 # TRUE 3:4 %allin% 1:3 # FALSE 3:4 %anyin% 1:3 # TRUE 4:5 %anyin% 1:3 # FALSE 3:4 %nonein% 1:3 # FALSE 4:5 %nonein% 1:3 # TRUE "Bei" %partin% c("Beijing", "Shanghai") # TRUE "bei" %partin% c("Beijing", "Shanghai") # FALSE "[aeiou]ng" %partin% c("Beijing", "Shanghai") # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.