Learn R Programming

matlab2r (version 1.5.0)

setdiff: Set differences of two arrays

Description

Loosely replicates the behavior of the homonym Matlab function

Usage

setdiff(A, B, legacy = FALSE)

Value

An array containing he elements which are in A but not in B

Arguments

A

first array

B

second array

legacy

if TRUE, preserves the behavior of the setdiff function from MATLAB R2012b and prior releases. (currently not supported)

Author

Waldir Leoncio

Examples

Run this code
A <- c(3, 6, 2, 1, 5, 1, 1)
B <- c(2, 4, 6)
setdiff(A, B)

Run the code above in your browser using DataLab