permutation: Permutation

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

View source: R/shallot.R

Description

These function define a permutation for subsequent use.

Usage

1
2
3
4
permutation(..., n.items = NULL, fixed = TRUE)

## S3 method for class 'shallot.permutation'
print(x, ...)

Arguments

...

For the function permutation, a permutation of the integers 1, 2,... n, where n is the length of the vector. For the function print.shallot.permutation, this is ignored.

n.items

An optional argument provided instead of ... to request a random partition. The argument fixed must be FALSE.

fixed

Should the permutation be fixed?

x

An object of class shallot.permutation.

Details

A valid permutation of length n is an integer vector of length n containing each integer 1, 2,... n only once.

Value

An object of class shallot.permutation.

Author(s)

David B. Dahl dahl@stat.byu.edu

References

Dahl, D. B., Day, R., and Tsai, J. (2017), Random Partition Distribution Indexed by Pairwise Information, Journal of the American Statistical Association, 112, 721-732. <DOI:10.1080/01621459.2016.1165103>

See Also

attraction

Examples

1
2
3
4
## Demonstrate permutation.
permutation(c(3, 1, 2, 5, 4))
permutation(c(3, 1, 2, 5, 4), fixed=FALSE)
permutation(n.items=5, fixed=FALSE)

shallot documentation built on Nov. 10, 2020, 5:09 p.m.