Displaying 20 results from an estimated 30000 matches similar to: "Combinations"
1999 Sep 29
2
avoiding loops, gaining generality
Hi, all.
Given an array, I'd like to add elements whose location vectors are
permutations of one another. For example, in a 3-dimensional array, I'd
add the elements in positions (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2)
and (3,2,1); those in positions (1,2,4), (1,4,2), (2,1,4), (2,4,1),
(4,1,2), and (4,2,1); and so on. Elements with repeated positions
-- (1,1,2) or (1,4,4), for
2007 Nov 15
3
generate combination set
I have a set data={A,B,C,D,E,F,G}
I want to choose 2 letter from 8 letters, i.e. generate the combination set
for choose 2 letters from 8 letters.
I want to get the liking:
combination set={AB,AC,AD,....}
Does anyone konw how to do in R.
thanks,
Aimin
2006 Dec 13
1
combinations of m objects into r groups
Hi!
Suppose I have m objects. I need to find out what are all possible ways
I can group those m objects into r groups. Moreover, I need to create a
matrix that contains what those arrangements are. I've created code for
when r=2 but I've come to a halt when trying to generalize it into r groups.
For example, if I have m=6 objects and I want to arrange them into
groups of r=2, there
2000 Dec 01
1
text in new window
Hello all,
For presentation and printing purposes I'd like to be able to open a new
window device and write text and/or include an object (mostly matrices or
lists).
I've tried around windows(), but which I'd expect to work doesn't:
windows(text(results)),
or windows(parse("Final result:",results))
-"results" is a numeric object-.
Thanks for any help,
Alex
2000 Sep 19
2
Simple command
Is there an "execute" command such that:
execute(paste("X[3]<-5"))
or
execute(paste("anything"))
where "anything" is executed by R??
Thanks,
Alex Ahgarin
________________________________________________________________
Data Management
ISC Inc.
Washington, DC.
-----------------------------------------------
FREE! The World's Best Email Address
2006 Oct 13
5
combinatorics
Hi
How do I generate all ways of ordering sets of indistinguishable items?
suppose I have two A's, two B's and a C.
Then I want
AABBC
AABCB
AACBC
ABABC
. . .snip...
BBAAC
. . .snip...
CBBAA
[there are 5!/(2!*2!) = 30 arrangements. Note AABBC != BBAAC]
How do I do this?
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14
2009 Dec 11
3
Correcting for missing data combinations
I can think of many brute-force ways to do this outside of R, but was
wondering if there was a simple/elegant solution within R instead.
I have a table that looks something like the following:
Factor1 Factor2 Value
A 11/11/2009 5
A 11/12/2009 4
B 11/11/2009 7
B 11/13/2009 8
>From that I need to generate all permutations of Factor1 and Factor2 and
force a 0 for any combination that doesn?t
2000 Dec 17
1
functions for subsets: a minor R programming challenge
Neils Waller asks
> -----Original Message-----
> From: niels Waller [mailto:niels.waller at home.com]
> Sent: Sunday, 17 December 2000 8:31
> To: r-help at stat.math.ethz.ch
> Subject:
>
> Does anyone know of an R (or S-PLUS) function for delineating
> all possible combinations and permutations?
>
> That is, for set (1,2,3) 3_C_2 = {1,2} {1,3} {2,3}
>
2004 Oct 16
7
sapply and loop
Dear all,
I am doing 200 times simulation. For each time, I generate a matrix and
define some function on this matrix to get a 6 dimension vector as my
results.
As the loop should be slow, I generate 200 matrice first, and save them into
a list named ma,
then I define zz<-sapply(ma, myfunction)
To my surprise, It almost costs me the same time to get my results if I
directly use a loop
2004 Oct 16
7
sapply and loop
Dear all,
I am doing 200 times simulation. For each time, I generate a matrix and
define some function on this matrix to get a 6 dimension vector as my
results.
As the loop should be slow, I generate 200 matrice first, and save them into
a list named ma,
then I define zz<-sapply(ma, myfunction)
To my surprise, It almost costs me the same time to get my results if I
directly use a loop
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
2002 Oct 31
1
Re: gregmisc version 0.7.3 now available
Dear Greg,
Thanks for the new release. The decomposition of the SSQ is just what I need!
Regards,
Martin.
Martin Hoyle,
School of Life and Environmental Sciences,
University of Nottingham,
University Park,
Nottingham,
NG7 2RD,
UK
Webpage: http://myprofile.cos.com/martinhoyle
>>> gregory_r_warnes at groton.pfizer.com 10/30/02 07:16PM >>>
Version 0.7.3 of the gregmisc package
2012 Jul 14
1
changing the x axis labels in a time series plot
OK, this has to be simple but I've searched through help files, mailing
list archives and well, everything I could think of, and still no luck.
I simply want to change the x axis labels in a time series graph, from its
default numbering (which starts at 1 and increments by 1), to values I have
in another vector, "Year". It has to be a time series graph, I don't want
to have to
2010 Oct 04
2
Combinations
Hi all,
I´ve been ill and I have lost a lot of time without seen the pc.
I want you to help if you can if you want.
Only I need an initial guide. I´ve been out a lot of time and I need a hope.
Is only for "joby" purposes.
The problem:
I want to simulate each of the posible combination in a play. Imagine they
play to games (football games) and you can choose "1",
2004 Sep 29
2
defining a template for functions via do.call and substitute.
Hi,
Given a function
fun <- function(a, b) a + b
how do I generate the function 'function(x, y) x + y'?
Working from the help files and Bill Venables' R-news article (June 2002),
I have tried various permutations with substitute without success.
e.g.
do.call("substitute", list(fun, list(a = as.name("x"), b = as.name("y"))))
Regards,
John.
2002 Sep 23
3
New version of gregmisc package
Version 0.6.0 of the gregmisc package has just been released on CRAN.
Description:
===========
Package: gregmisc
Description: Misc Functions written/maintained by Gregory R. Warnes
Title: Greg's Miscellaneous Functions
Version: 0.6.0
Date: 2002/09/23
Maintainer: Gregory R. Warnes <Gregory_R_Warnes at groton.pfizer.com>
Author: Gregory R. Warnes. Includes code provided by Ben
2002 Sep 23
3
New version of gregmisc package
Version 0.6.0 of the gregmisc package has just been released on CRAN.
Description:
===========
Package: gregmisc
Description: Misc Functions written/maintained by Gregory R. Warnes
Title: Greg's Miscellaneous Functions
Version: 0.6.0
Date: 2002/09/23
Maintainer: Gregory R. Warnes <Gregory_R_Warnes at groton.pfizer.com>
Author: Gregory R. Warnes. Includes code provided by Ben
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
2010 Jul 08
2
Alternativas a uso de variables globales
Hola a tod en s,
tengo una duda que se relaciona con alternativas al uso de variables globales.
En principio, si se quiere usar un generador de v.a con la librería
Runuran sólo se permite definir las funciones de densidad (o el núcleo
de las mismas) con funciones con un único argumento en (x).
Sin embargo, necesito pasar a las funciones más argumentos que van
cambiando en las iteraciones de
2008 Jul 30
1
model mix problem. FALSE CONVERGENCE
Hi R users
I try to use the lme but I can?t!!!!!
My script is (some words in french, sorry!!):
rm(list=ls(all=TRUE)) #Efface tous les objets en m?moire pour ?viter des
erreurs
library(MASS) #Chargement des Librairies
library(car)
library(Hmisc)
library(tkWidgets)
library(svDialogs)
library(multtest)
library(nlme)
#Rep <- "C:/Documents and Settings/U3M/Bureau/steph/Scripts