%nin% {quickcode}R Documentation

Not in vector or array

Description

Check if entry is in vector

Usage

x %nin% table

Arguments

x

vector entry

table

table of items to check

Value

a boolean value to indicate if entry is present

Examples

5 %nin% c(1:10) #FALSE
5 %nin% c(11:20) #TRUE

x = "a"
if(x %nin% letters) x

# let's say we are trying to exclude numbers from a vector
vector_num1 <- number(9, max.digits = 5, seed = 1) #simulate 9 numbers
vector_num1 #values
vector_num1[vector_num1 %nin% c(83615,85229)]#return values not 83615 or 85229

[Package quickcode version 0.8 Index]