search for: hcube

Displaying 7 results from an estimated 7 matches for "hcube".

Did you mean: cube
2005 Dec 08
0
Finding all possible partitions of N units into k classe
...his gives N-1 binary digits i1 i2 ... i[N-1] (note that none of these will have all binary digits = 0). Then assign unit "j+1" to Class 1 if ij = 0, otherwise to Class 2. However, that is if you want to do it with your bare hands! The package combinat contains also the function 'hcube' which can be readily adapted to do just that (since it initially generates all the 2^N combinations of the above). library(combinat) ?hcube x<-rep(2,4) # for partitions of 4 units into classes {1,2} hcube(x,scale=1,transl=0) # [,1] [,2] [,3] [,4] # [1,] 1 1 1 1 # [2,]...
2005 Dec 08
3
Finding all possible partitions of N units into k classes
Dear useRs! I would like to generate a list of all possible (unique) partitions of N units into k classes. For example, all possible partitions of 4 units into 2 classes are (I hope I have not missed anyone): 1,1,1,2 (this can be read as {1,2,3},{4}) 1,1,2,1 1,2,1,1 2,1,1,1 1,1,2,2 1,2,1,2 1,2,2,1 The partitions 1,1,2,2 and 2,2,1,1 are the same and are therefore not two unique
2006 Aug 21
0
Fw: Permutations with replacement
...A WORKAROUND # WORKAROUND: 1) Construct the 8 to the 7 power hypercube. 2) For these data, create eight additional data sets that include # the last position to finish the construction of an 8^8 hypercube #x <- rep(8,8) # for partitions of 8 units into classes {1,2,3,4,5,6,7,8} #hcube8 <- hcube(x, scale=1, transl=0) #hcube8 #step 1: 8^7 = 2,097,152 x1 <- rep(8,7) x1 hcube87 <- hcube(x1, scale=1, transl=0) #this will generate 2,097,152 results from 1-8 but for only 7 positions #step 2: column bind each file with 1-8 in the 8th position #x1a <- cbind(hcube87,1) #x2...
2007 Oct 27
2
How to generate all permutation of 0-1 sequences in R?
Hi, folks: I need to generate all 0-1 sequences with given length,say,n=3, the ideal result would be the following matrix: 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Any help would be appreciated. -- View this message in context: http://www.nabble.com/How-to-generate-all-permutation-of-0-1-sequences-in-R--tf4704377.html#a13446919 Sent from the R help mailing list archive at Nabble.com.
2006 Aug 18
1
Permutations with replacement
Is there a simple function or process that will create a matrix of permutations with replacement? I know that using the combinat package ###### begin R code ###### > library(combinat) > m <- t(array(unlist(permn(3)), dim = c(3, 6))) # we can get the permutations, for example 3!=6 # gives us > m [,1] [,2] [,3] [1,] 1 2 3 [2,] 1 3 2 [3,] 3 1 2 [4,]
2012 Aug 17
0
install.packages umask configuration
...binat? ... ** Creating default NAMESPACE file ** R ** preparing package for lazy loading ** help *** installing help indices converting help for package ?combinat? finding HTML links ... done combn html dmnom html hcube html nsimplex html permn html rmultinomial html x2u html xsimplex html ** building pac...
2006 May 08
3
Non repetitive permutations/combinations of elements
Hello all, I am trying to create a matrix of 1s and -1s without any repetitions for a specified number of columns. e.g. 1s and -1s for 3 columns can be done uniquely in 2^3 ways. -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1 and for 4 columns in 2^4 ways and so on. I finally used the function combn([0 1],3) that I found at the following link