Full_Name: Obnoxious Version: 2.7.0 OS: Windows Submission from: (NULL) (121.223.77.238)
Objective: Generate all permutations of the elements of x taken m at a time. Library: prob Function: permsn Issue: Does not appear to be working correctly when x==m. Example: libary(prob) permsn(2,1) i.e., x > m #Gives the correct result of [,1] [,2] [1,] 1 2 #Yet permsn(2,2) i.e., x==m #Gives the incorrect? result of [1] 1 2 #Shouldn't the result be [,1] [,2]??? [1] 1 2??? [2] 2 1??? #Workaround: permsn(3,2) i.e. permsn(x+1,m) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1 2 1 3 2 3 [2,] 2 1 3 1 3 2 #but then we have to remove the results with x==3 in them #hope that all makes sense Thankyou, Obby ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel