Displaying 20 results from an estimated 2000 matches similar to: "Constrained vector permutation"
2007 Jan 30
2
Permutation problem
Dear R-Users,
I need a matrix containing line by line all possible permutations with
length 'i' of the integers 1:N, given the restriction that the
integers in each row have to be in ascending order.
For example: N = 5, length i = 3, should result in a matrix like this:
1 2 3
1 2 4
1 2 5
1 3 4
1 3 5
1 4 5
2 3 4
2 3 5
2 4 5
3 4 5
I'm grateful for any advice on
2009 Dec 18
2
Generating permutations that always include one specific element
Dear R community,
I am trying to create a matrix of permutations of a vector:
bands <- c("AL", "B", "DB", "DG", "G", "K", "LB", "LG", "MG", "O", "P",
"PI", "PK", "PU", "R", "V", "W", "Y")
Each permutation must be 4
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
2017 Jul 07
1
How does findAssocs() calculate the correlation value ??
hi:
I want to know the math behind the "tm" package findAssocs().
I have found that someone had asked the question before, and have a good explanation by Rick.
?]http://r.789695.n4.nabble.com/findAssocs-td3845751.html?^
But I still don't understand how to calculate the correlation value between the two vectors.
For example:
# Correlation word2 with word3
2012 Feb 28
2
Error: could not find function "hier.part"
Error: could not find function "hier.part"
things I have tried:
1. reinstall R (lastest version, on windows XP)
2. install package "gtools"
3. include:
library(gtools)
require(gtools)
4. how I call this function:
hier.part(c$Y, xdata, fam = "gaussian", gof = "Rsqu")
5.when I try to check what's in the package "gtools", I get (hier.part is
2009 Sep 06
1
Two packages and one method
Hi!
I want to use one method "combinations" from "gtools" package but in my code
I must use also "dprep" method where is method "combinations" too. Mayby I
show you result my help function:
Help on topic 'combinations' was found in the following packages:
Package Library
dprep /usr/lib64/R/library
gtools
2005 Feb 14
3
'combinations' in gtools and stack overflow
Dear R-users,
Let me ask about the 'stack overflow' error which I got when I used
the function 'combinations' in "gtools".
The following is what I did:
---------
library(gtools)
options(expressions=1e5)
combinations(500, 3, 1:500)
# or combinations(400, 2, 1:400)
Error: protect(): stack overflow
---------
How can I overcome this error?
Is there perhaps any other
2010 Apr 27
1
Problem installing gtools package
Hello,
I am attempting to install the gtools package, so that I can compute the
permutations of a set. However, I having difficulties. My problems are:
1) When I use the GUI "Install package(s)" command, the package "gtools"
does not appear in my list.
2) I dowloaded the package from
http://cran.r-project.org/web/packages/gtools/ . I Then used the GUI
command
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:
2011 Nov 18
3
Permutations
Hi all,
why factorial(150) shows the error out of range in 'gammafn'?
I have to calculate the number of subset formed by 150 samples taking 10 at
a time. How is this possible?
best
[[alternative HTML version deleted]]
2018 Mar 30
3
getting all circular arrangements without accounting for order
Thanks!
Yes, however, this seems a bit wasteful. Just wondering if there are other, more efficient options possible.
Best wishes,
Ranjan
On Thu, 29 Mar 2018 22:20:19 -0400 Boris Steipe <boris.steipe at utoronto.ca> wrote:
> If one is equal to the reverse of another, keep only one of the pair.
>
> B.
>
>
>
> > On Mar 29, 2018, at 9:48 PM, Ranjan Maitra
2009 Mar 14
2
permutations in R
Hi. Does anyone know of a function which will take as input a number n (or a
set of n letters) and will give out, one at a time, the permutations of n
(or of those n letters) as a vector?
So that I can use the permutations one at a time. And such that it will
exhaust all the permutations with no repeats.
For example if n is 3, I would want a function which I could use in a loop
and the first time
2007 Apr 18
2
Error loading libraries in MAC
Hi I just installed the gmodels package
and the installation was successful but when I was trying to load the
library I got an error (see below).
Interesting, yesterday I wrote to the maintainer of RSQLite apckage
because I got the same error.
Does somebody knows what is going on ??
thanks,
Mayte
library(gmodels)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load
2007 Apr 18
2
Error loading libraries in MAC
Hi I just installed the gmodels package
and the installation was successful but when I was trying to load the
library I got an error (see below).
Interesting, yesterday I wrote to the maintainer of RSQLite apckage
because I got the same error.
Does somebody knows what is going on ??
thanks,
Mayte
library(gmodels)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load
2018 Mar 30
0
getting all circular arrangements without accounting for order
I don't know if this is more efficient than enumerating with distinct
directions and weeding... it seems kind of heavyweight to me:
#######
library(gtools)
directionless_circular_permutations <- function( n ) {
v <- seq.int( n-1 )
ix <- combinations( n-1, 2 )
jx <- permutations( n-3, n-3 )
x <- lapply( seq.int( nrow( ix ) )
, function( i ) {
2009 Sep 03
1
trouble installing gtools package in local directory
Hello,
I've recently transitioned to using R in Linux. My OS/installation versions
are:
$ Red Hat Enterprise Linux AS release 4 (Nahant Update 6)
$ Linux lx-chgmqsd05 2.6.9-67.0.1.ELsmp #1 SMP Fri Nov 30 11:57:43 EST 2007
x86_64 x86_64 x86_64 GNU/Linux
I am trying to create a repository of packages under ~/R/library which I've
created since I do not have admin access on my system. From my
2009 Sep 03
1
trouble installing gtools package in local directory
Hello,
I've recently transitioned to using R in Linux. My OS/installation versions
are:
$ Red Hat Enterprise Linux AS release 4 (Nahant Update 6)
$ Linux lx-chgmqsd05 2.6.9-67.0.1.ELsmp #1 SMP Fri Nov 30 11:57:43 EST 2007
x86_64 x86_64 x86_64 GNU/Linux
I am trying to create a repository of packages under ~/R/library which I've
created since I do not have admin access on my system. From my
2010 Apr 22
1
packages gdata / gtools - installation in R 2.11.0
Dear R-list members,
I have just downloaded R version 2.11.0. Then I installed
package gdata. At the end of the installation, a warning message
said that package gtools could not be found. Package gdata
was, after the installation, included in the "Package Index"
in the help files. Messages during installation (which was made
through the menu Packages / Instal package(s), choosing the
2007 Feb 20
4
linux gplots install unhappy
Hello all,
I use R on both windows and a "mainframe" linux installation (RedHat
enterprise 3.0, which they tell me is soon to be upgraded to 4.0). On
windows I installed the package gplots without trouble, and it works fine.
When I attempted to do the same on the unix computer, the following error
message was forthcoming:
downloaded 216Kb
* Installing *source* package
2018 Mar 12
7
Equivalent of gtools::mixedsort in R base
Hi,
Searching for functions that would order strings that mix characters and numbers in a "natural" way (ie, "a1 a2 a10" instead of "a1 a10 a2"), I found the mixedsort and mixedorder from the gtools package.
Problems:
1- mixedorder does not work in a "do.call(mixedorder, mydataframe)" call like the order function does
2- gtools has not been updated in 2.5