Displaying 20 results from an estimated 700 matches similar to: "Permutations with replacement"
2006 Jul 13
1
looping using combinatorics
I have a problem where I need to loop over the total combinations of
vectors (combined once chosen via combinatorics). Here is a
simplification of the problem:
STEP 1: Define three vectors a, b, c.
STEP 2: Combine all possible pairwise vectors (i.e., 3 choose 2 = 3
possible pairs of vectors: ab,ac, bc)
NOTE: the actual problem has 8 choose 4, 8 choose 5 and 8 choose 6
combinations.
STEP
2006 Jul 18
1
Reconfiguring wide frame to long frame
Greetings, fellow R'ers.
How can I get this frame in R:
ID meas ID.1 meas.1
1 1.1 3 1.2
2 2.1 4 2.2
to look like this (stacking):
ID meas
1 1.1
2 2.1
3 1.2
4 2.2
It's not really the reshape function (or is it?) because we can consider
the additional columns, viz., ID.1 and meas.1, as independent of ID and
meas so it is basically a stacking
2006 Aug 21
0
Fw: Permutations with replacement
My apologies, I forgot to CC: to the list on my previous communication
with Daniel.
Jesse
----- Forwarded by Jesse Albert Canchola/EMVL/DIAG/US/BAYER on 08/21/2006
10:50 AM -----
Jesse Albert Canchola/EMVL/DIAG/US/BAYER
08/21/2006 09:36 AM
To
"Daniel Nordlund" <res90sx5 at verizon.net>
cc
Subject
RE: [R] Permutations with replacement
Thanks, Daniel. I need to enumerate
2006 Oct 29
2
Rgui.exe fix for "console not found" buffer overflow problem
I'm using R on Windows XP Professional SP2.
I figured out the fix for my buffer overflow problem that did not allow me
to use Rgui.exe for about two weeks. I would keep getting "console not
found" and even when I uninstalled and re-installed got the same problem.
Here's how the problem started. In Rgui.exe, I attempted to get more
visible output in the buffer (I wanted
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
2010 Jan 18
2
permutations from vectors out of a matrix
Dear R-Users,
I'm relativley new to R and have the following problem. I need all
permutations of the vectors created by the collumns of a matrix. I will
give a small example:
p=3
n=2^p-1
#number of obtainable vectors
mat=matrix(0,p,p)
for(i in 1:p)
{
mat[i:1,i]=1/i
}
mat is now a
2009 Oct 10
1
permutations
Question 1.
I would calculate all the permutations of numbers (23,46,70,71,89)
How can I write correctly the code?
(Load gregmisc)
> permutations (..?...)
______________________
Question 2.
It's possible permute a string?
..for example:
EIGER
EGIER
EREGI
etc..etc..
Thanks,
E.
--
View this message in context: http://www.nabble.com/permutations-tp25834463p25834463.html
Sent from the R
2006 Aug 02
2
listing of permutations
Dear R People:
Suppose I have the 4 numbers: 1,2,3,4.
I would like to create a listing of the permutations
of 4 items taken 4 at a time.
Is there a built in function for that, please?
Thanks in advance!
R 2-3-1 for Windows or Linux
Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgess at gator.uhd.edu
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
2008 Apr 06
3
Multiset Permutations
Dear R users,
I want to perform an exact permutation of multisets. I have looked at the
coin package, but it doesn't seem to offer what I am looking for. I want to
perform permutations (exact - without duplications) on multisets of scalars
(e.g., the multiset 0,0,1,2,2). I want to output all the possible
permutations into a data frame so that each multiset permutation occupies a
row (or
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.
2011 Dec 01
2
permutate elements in a vector
Hi all,
I have a vector, e.g., A = c(10, 20, 30, 40). This 4 numbers have 4! = 24
different combination. I want to generate a matrix with one combination in
one row, so the output would be
B =
10 20 30 40
10 40 20 30
...
Does anyone know how to do this easily in R? Thank you very much.
Wendy
--
View this message in context:
2015 Mar 22
3
Combinatoria
Hola amigos, muchas gracias por vuestra ayuda.
Entonces veo que mi sorpresa era legítima. Por todos vuestros mails la
conclusión es que:
- En el módulo base de R no incluye combinatoria elemental, ni siquiera
el número combinatorio Cm,n hay que cargar el paquete *combinat*
- Y para las variaciones con repetición el paquete* gtools*
- Y aún así no tenemos ni las combinaciones ni las
2012 Jun 01
1
R Error : Error in vector("list", gamma(n + 1)) : vector size specified is too large
Dear R-listers,
I am giving part of my R code :
###########################################################
n=15
m=1
library("partitions")
library("gregmisc")
library("combinat")
x = t(restrictedparts(n-m,m))
l = length(x[,1])
for(u in 1:l){
A= unique(matrix( unlist(permn(x[u,])), ncol=m, byrow=TRUE ))
}
2015 Mar 22
2
Combinatoria
Hola Miguel,
Sí se pueden obtener las variaciones con y sin repetición en R.
Eso sí están un poco escondidas...
Se pueden calcular de esta forma:
#----------------------
> #Cargar el paquete gtools
> library(gtools)
> #Definir el conjunto sobre el que se hará el cálculo
> x <- c('rojo', 'azul', 'verde')
> #Utilizar la función "permutations()"
2008 Dec 05
1
Lexical Permutation Algorithm in R
Hi all
Here is a rather naive implementation of the SEPA algorithm for generating lexical permutations:
lexperm3 <- function(x, n=length(x)) {
perms <- list()
k <- 1
perms[[k]] <- x
k <- k + 1
for (y in 1:(factorial(n)-1)) {
i <- n-1
while (x[i] > x[i+1] && i > 0) {
i <- i - 1
}
# i is largest index st x[i] > x[i+1]
j <- n
#
2015 Mar 21
4
Combinatoria
En relación con lo que comenta Carlos, por ejemplo para el caso de las Variaciones sin Repetición, puede ser instructivoenseñar como se construye como por ejemplo:
VsinR <- function(m, n){ return (factorial(m)/factorial(m-n))}
VsinR(9,3)
-------------------------
Creo que con la función factorial que viene por defecto en R puedes construir siguiendo este modelo rápidadmentecasi cualquier
2015 Mar 22
2
Combinatoria
Sí, también...
Para las permutaciones, n=r.
Y con el parámetro "repeats.allowed" controlas si son con o sin repetción:
#----------------------
> #Permutaciones *con repetición*
> permutations(n=3, r=3, v=x, repeats.allowed=TRUE)
[,1] [,2] [,3]
[1,] "azul" "azul" "azul"
[2,] "azul" "azul" "rojo"
[3,]
2015 Mar 02
3
PERMUTACIONES EN R
Buena tarde amigos,
En días pasados hice algunas consultas y ya pude salir de las dudas que
tenia en ese momento, ahora requiero de su colaboración con lo siguiente:
Tengo un vector dicotomico (Binario) con la siguiente información que me
surgio de algunos procesos anteriores:
> MuestraS
[1] 1 1 1 1 0 1 1 0 1 1
Ahora necesito hallar todas las posibles combinaciones que se puedan hacer
con
2008 Jan 25
1
increasing speed for permutations of glm
Dear R Programmers,
I am trying to run a Poisson regression on all pairs of variables in a data
set and
obtain the permutation distribution. The number of pairs is around 100000.
It seems my code will take weeks to run, unless I try something else.
Could you give me any suggestions on how to improve the speed of the
code below, or any general suggestions on how I may accomplish this task.
Thanks