sgn | R Documentation |
The sign of a permutation is +/-1 depending on whether it is even or odd
sgn(x) is.even(x) is.odd(x)
x |
permutation object |
Coerces to cycle form
Robin K. S. Hankin
shape
sgn(id) # always problematic sgn(rperm(10,5)) x <- rperm(40,6) y <- rperm(40,6) stopifnot(all(sgn(x*y) == sgn(x)*sgn(y))) # sgn() is a homomorphism z <- as.cycle(rperm(20,9,5)) z[is.even(z)] z[is.odd(z)]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.