is.permutation: Check if its argument is a permutation

Description Usage Arguments Value Examples

View source: R/PerMallows.R

Description

This function tests if the given argument is a permutation of the first n natural integers (excluding 0)

Usage

1

Arguments

perm

a vector (or a bidimensional matrix)

Value

TRUE iff perm is a valid permutation (or a matrix of valid permutations)

Examples

1
2
3
is.permutation(c(3,1,2,4))
is.permutation(c(6,1,2,3))
is.permutation(matrix(c(1,2,3, 4,1,4,3,2,1,2,4,3), nrow = 3, ncol = 4, byrow = TRUE))

Example output

Loading required package: Rcpp
[1] TRUE
[1] FALSE
[1] TRUE

PerMallows documentation built on May 2, 2019, 6:14 a.m.