permsn: Generate All Permutations of x Elements Taken m at a Time

Description Usage Arguments Value Author(s) See Also Examples

Description

Generate all permutations of the elements of x taken m at a time. If x is a positive integer, returns all permutations of the elements of seq(x) taken m at a time.

Usage

1
permsn(x, m)

Arguments

x

vector source for permutations, or integer n for x <- seq(n).

m

number of elements to permute.

Value

a list or array (in nondegenerate cases).

Author(s)

G. Jay Kerns gkerns@ysu.edu, modified from the combn function in the package utils.

See Also

combn

Examples

1
permsn(3,2)

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

     [,1] [,2] [,3] [,4] [,5] [,6]
[1,]    1    2    1    3    2    3
[2,]    2    1    3    1    3    2

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