setdiff: Set Difference of Subsets

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculates the (nonsymmetric) set difference of subsets of a probability space.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
setdiff(x, ...)

## Default S3 method:
setdiff(x, y, ...)

## S3 method for class 'data.frame'
setdiff(x, y, ...)

## S3 method for class 'ps'
setdiff(x, y, ...)

Arguments

x, y

vectors, data frames, or ps objects containing a sequence of items (conceptually).

...

further arguments to be passed to or from other methods.

Details

This function operates row-wise on dataframes, and element-wise among the outcomes of ps objects. The elements of setdiff(x,y) are those elements in x but not in y. The definition is taken to match the version in the base package.

Value

A data frame or subset of a probability space of the same type as its arguments.

Author(s)

G. Jay Kerns gkerns@ysu.edu, essentially verbatim from a suggestion made by Brian Ripley on R-devel, 12/11/07.

See Also

intersect, union

Examples

1
2
3
4
S <- cards()
A <- subset(S, suit == "Heart")
B <- subset(S, rank == "A" )
setdiff(B, A)

aflaherty13/prob documentation built on May 28, 2019, 4:42 p.m.