powered by
This function tests if the given argument is a permutation of the first n natural integers (excluding 0)
is.permutation(perm)
TRUE iff perm is a valid permutation (or a matrix of valid permutations)
a vector (or a bidimensional matrix)
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))
Run the code above in your browser using DataLab