Closed RobinHankin closed 5 months ago
Following is a more clear example:
library("permutations")
#>
#> Attaching package: 'permutations'
#> The following object is masked from 'package:stats':
#>
#> cycle
orbit(as.cycle("(145)(29)"),3)
#> NULL
by any reasonable criterion, the orbit of 3 should be 3. In the previous example it might be argued that the cycle (123)
is an element of $S_3$ and as such the permutation's effect on element 5 is undefined.
Reopening; orbit()
has difficulty with the identity permutation:
library("permutations")
#>
#> Attaching package: 'permutations'
#> The following object is masked from 'package:stats':
#>
#> cycle
orbit(c(as.cycle("(145)(29)"),id),3)
#> Error in which(unlist(lapply(c1, function(x) {: argument to 'which' is not logical
Created on 2024-03-14 with reprex v2.1.0
Not sure if it is a "bug" as such, but
orbit()
returnsNULL
if the element in question is unaltered by the permutation:Arguably it should return
5
here; in any case this behaviour is not documented.