Learn R Programming

NetRep (version 1.0.2)

matchsub: Value Matching and Subsetting

Description

This set of functions provides shortcuts for value matching and subsetting, on top of the functionality provided by %in%.

%nin% returns a logical vector indicating if elements of x are not in table, This is the opposite of %in%.

%sub_in% returns the elements x that are %in% table rather than a logical vector.

%sub_nin% returns the elements x that are %nin% table rather than a logical vector.

Usage

x %nin% table
x %sub_in% table
x %sub_nin% table

Arguments

x
vector or NULL: the values to be matched. Long vectors are supported.
table
vector or NULL: the values to be matched against. Long vectors are not supported.