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)

Example output

Loading required package: combinat

Attaching package: 'combinat'

The following object is masked from 'package:utils':

    combn

Loading required package: fAsianOptions
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics


Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Loading required package: fOptions


Rmetrics Package fOptions
Pricing and Evaluating Basic Options
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Loading required package: hypergeo
Loading required package: VGAM
Loading required package: stats4
Loading required package: splines

Attaching package: 'VGAM'

The following object is masked from 'package:hypergeo':

    is.zero

The following object is masked from 'package:fAsianOptions':

    erf


Attaching package: 'prob'

The following objects are masked from 'package:base':

    intersect, setdiff, union

   rank    suit
13    A    Club
26    A Diamond
52    A   Spade

prob documentation built on May 2, 2019, 12:20 p.m.