Displaying 20 results from an estimated 7000 matches similar to: "'combinations' in gtools and stack overflow"
2008 Nov 24
3
Help With Permutations
I have a problem with permutations functions in R
I just started using R so maybe it is an easy question
I need to obtain all the 9.somthingExp 157 permutations that can be
given from the number from 1 to 100
I wrote the following commands:
> library(gregmisc)
>options(expressions=1e5)
cmat <- combinations(300,2)
dim(cmat) # 44850 by 2
>permutations(n=100, r=100)
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
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
2008 Oct 15
1
error installing gtools (PR#13168)
Full_Name: Ebi Hal
Version: R-2.7.2-1
OS: Fedora core 9
Submission from: (NULL) (129.215.170.238)
I tried to install gplots by running
R> install.packages("gplots")
but the process failed while installing "gtools" with the following error
message:
* Installing to library '/usr/lib64/R/library'
* Installing *source* package 'gtools' ...
** libs
gcc -m64
2006 Oct 21
2
problem with mode of marginal distriubtion of rdirichlet{gtools}
Hi all,
I have a problem using rdirichlet{gtools}.
For Dir( a1, a2, ..., a_n), its mode can be found at $( a_i -1)/ (
\sum_{i}a_i - n)$;
The means are $a_i / (\sum_{i} a_i ) $;
I tried to study the above properties using rdirichlet from gtools. The code
are:
##############
library(gtools)
alpha = c(1,3,9) #totoal=13
mean.expect = c(1/13, 3/13, 9/13)
mode.expect = c(0, 2/10, 8/10) #
2018 Mar 12
0
Equivalent of gtools::mixedsort in R base
split any mixed columns into letter and number columns
and then order can be used on that:
DF <- data.frame(x = c("a10", "a2", "a1"))
o <- do.call("order", transform(DF, let = gsub("\\d", "", x),
no =
as.numeric(gsub("\\D", "", x)),
2018 Mar 12
1
Equivalent of gtools::mixedsort in R base
x <- c( "a1", "a10", "a2" )
y <- c( "b10", "b2", "a12", "ca1" )
DF <- expand.grid( x = x, y = y )
# randomize
set.seed( 42 )
DF <- DF[ sample( nrow( DF ) ), ]
# missing from gtools
mixedrank <- function( x ) {
seq.int( length( x ) )[ gtools::mixedorder(x) ]
}
o <- do.call( order, lapply( DF, mixedrank ) )
2018 Mar 12
0
Equivalent of gtools::mixedsort in R base
1- mixedorder does not work in a "do.call(mixedorder, mydataframe)"
call like the order function does
This is tangential, but do.call(order, mydataframe) is not safe to use in a
general purpose function either - you need to remove the names from
the second argument:
> d <- data.frame(method=c("New","New","Old","Old","Old"),
2018 Mar 12
0
Equivalent of gtools::mixedsort in R base
???
> y <- sort( c("a1","a2","a10","a12","a100"))
> y
[1] "a1" "a10" "a100" "a12" "a2"
> mixedsort(y)
[1] "a1" "a2" "a10" "a12" "a100"
**Please read the docs!** They say that mixedsort() and mixedorder() both
take a **single
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
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
2010 Mar 03
2
Working with combinations
I am working with the combinations function (available in the gtools package). However, rather than store all of the possible combinations I would like to check each combination to see if it meets a certain criteria. If it does, I will then store it.
I have looked at the combinations code but am unsure where in the algorithm I would be able to operate on each combination.
Thanks!
2005 Dec 13
0
Updated version of gdata, gtools, gplots and gmodels
Hello,
We have submitted the updated version of gdata, gmodels, gplots and gtools to CRAN.
Summary of the changes is attached at the end.
Best,
Nitin
______________________
Nitin Jain, PhD
<nitin.jain at pfizer.com>
Non Clinical Statistics
Pfizer, Inc. (Groton, CT)
Bldg: 260, # 1451
Ph: (860) 686-2526 (Office)
Fax: (860) 686-6170
Brief description of changes:
CHANGES IN GDATA 2.1.2
2005 Dec 13
0
Updated version of gdata, gtools, gplots and gmodels
Hello,
We have submitted the updated version of gdata, gmodels, gplots and gtools to CRAN.
Summary of the changes is attached at the end.
Best,
Nitin
______________________
Nitin Jain, PhD
<nitin.jain at pfizer.com>
Non Clinical Statistics
Pfizer, Inc. (Groton, CT)
Bldg: 260, # 1451
Ph: (860) 686-2526 (Office)
Fax: (860) 686-6170
Brief description of changes:
CHANGES IN GDATA 2.1.2
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
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
2010 Aug 18
2
combinations
I would appreciate any suggestions on which function to use to write subsequent functions analysing combinations of treatments.
This refers to experimental trials of medical treatments. I want to write routines to analyse various comparisons (combinations)
So .... if 5 treatments are available (t01, t02, t03, t04 and t05) I want to write a general routine that works out all possible