Displaying 20 results from an estimated 7000 matches similar to: "combinations"
2011 May 26
3
change function scope?
I'm still getting used to R's scoping. I've run into the following situation
value=0
thefunction <- function() print( value )
somefunction <- function() { value=99; thefunction() }
somefunction()
now, I understand that somefunction() returns 0 because thefunction() was
defined with value=0 in its parent envrionment, it dosent look at all in the
environment of somefunction. My
2001 Dec 05
2
paste doesn't appear to paste?
Sorry to be posting another question, but my learning curve is starting to
flatten some now.
What am I missing here?
> temp _ name[reis==toupper(location[order(Vgrablow2)][N])]
> temp
[1] "Lawton"
> paste(temp,g)
[1] "Lawton" # WHERE IS THE SECOND ELEMENT?
> g
[1] 0.29
> a _ "Lawton"
> paste(a,g)
[1] "Lawton 0.29"
2011 Mar 30
3
how about a "<p-" operator?
I was cursing Matlab again today (what else is new) because the default
action for every Matlab command is to spew the result to the console,
and one must remember to put that darn ";" at the end of every line.
So I just wondered: was there ever a discussion as to providing some
modified version of the "<-" and "->" operators in R to do the reverse?
2002 May 01
2
predict assistance
I have a question regarding application of model coefficients between
datasets. In particular, I have several datasets which I would like to apply
a model estimated from only a single dataset (sort of a crude - out of sample
application - to show the variances).
lets say,
names(a)
[1] "stdnoi" "momentum" "tbm3" "metcons" "premium"
2004 Jan 08
2
Sweave & xtable
I am just starting to learn Sweave (really neat tool). I am pretty
early in the learning curve (I had to think a moment ago whether a # or
% was the appropriate comment character).
I have successfully incorporated simple graphics and outputs, but am
having trouble getting a latex (xtable) table to function properly.
Latex is seemingly treating the xtable code as input or verbatim text.
That
2006 Mar 21
2
Multiple commands per priority
Hi everybody.
I have been searching and trying for an answer, but no luck, so here I go..
Is there anyway to execute multiple commands on a single priority in
extensions.conf?
eg:
exten => X.,1,Dial(SIP/1111) & somefunction(${EXTEN})
I need the dial command to dial internal extensions, and the
"somefunction" to
kick of our own outgoing system for redirection to outside lines;
2010 Dec 01
2
default arguments and '...' in a function
Dear R-users,
I'm trying to work out a way to set default values for arguments in a function which includes the optional argument '...'.
In practice, I have a 'plot' method for a function which specifies different types of plots. Every different plot should have different default arguments (for example for 'col', 'ylim' etc), plus the argument '...' to
2010 Jun 03
3
Interaction versus combinations
I can get the interactions between factors like this:
> idx=c(1,3,6,9)
> jdx=idx
> levels(interaction(idx,jdx,lex.order=TRUE))
[1] "1.1" "1.3" "1.6" "1.9" "3.1" "3.3" "3.6" "3.9" "6.1" "6.3" "6.6"
"6.9"
[13] "9.1" "9.3" "9.6"
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
2009 Apr 06
3
how to subsample all possible combinations of n species taken 1:n at a time?
Hello
I apologise for the length of this entry but please bear with me.
In short:
I need a way of subsampling communities from all possible communities of n
taxa taken 1:n at a time without having to calculate all possible
combinations (because this gives me a memory error - using
combn() or expand.grid() at least). Does anyone know of a function? Or can
you help me edit the
combn
or
2007 Jul 27
4
Looping through all possible combinations of cases
Hello!
I have a regular data frame (DATA) with 10 people and 1 column
('variable'). Its cases are people with names ('a', 'b', 'c', 'd',
'e', 'f', etc.). I would like to write a function that would sum up
the values on 'variable' of all possible combinations of people, i.e.
1. I would like to write a loop - in such a way that it
2004 Feb 27
1
Outer with Three Vectors
Hello,
outer() is great for avoiding things like:
for (val1 in val1s) {
for (val2 in val2s)) {
x[i,j] <- somefunction(val1, val2)
}
}
The same can be obtained with:
outer(val1s, val2s, somefunction)
But what if there are three (or more) sets of values to loop over? Any
way of avoiding the loops then?
Thanks,
--
Wolfgang Viechtbauer
2009 Oct 11
3
[LLVMdev] Problems linking shared library with __declspec(dllexport)
Hi all,
I am trying to use llvm-gcc to link shared libraries on windows/mingw32.
When I try to link libraries that contain functions declared with
__declspec(dllexport) someFunction();
I get the link error:
Cannot export _someFunction: symbol not found
Removing the declspec directive solves the problem, but this is not a
very feasible solution for me.
Using 'regular' gcc does not
2009 Sep 17
3
generating unordered combinations
Hi,
I am trying to generate all unordered combinations of a set of
numbers / characters, and I can only find a (very) clumsy way of doing
this using expand.grid. For example, all unordered combinations of
the numbers 0, 1, 2 are:
0, 0, 0
0, 0, 1
0, 0, 2
0, 1, 1
0, 1, 2
0, 2, 2
1, 1, 1
1, 1, 2
1, 2, 2
2, 2, 2
(I have not included, for example, 1, 0, 0, since it is equivalent to
0, 0, 1).
I have
2017 Aug 23
4
Getting all possible combinations
Hi again,
I am exploring if R can help me to get all possible combinations of
members in a group.
Let say I have a group with 5 members : A, B, C, D, E
Now I want to generate all possible unique combinations with all
possible lengths from that group e.g.
1st combination : A
2nd combination : B
.....
5th combination : E
6th combination : A, B
7th combination : B, C
....
last combination: A, B,
2009 Sep 07
2
calling combinations of variable names
R-2.9.1, Windows7
Dear list,
I have a question to you that seems very simple to me, but I just can't
figure it out.
I have a dataframe called "ratings" which contains the following
variables: evalR1, evalR2, evalR3, evalR4, scoreR1, scoreR2, scoreR3,
scoreR4, opinionR1, opinionR2, opinionR3, opinionR4. (there are more
variables, but this gives an idea of the data structure).
What
2002 Mar 18
3
function design
I have a, no doubt, simple question. I wish to write a function such
that
a <- 9
b <- 10
changer _ function(x,y) { if (y>x){ x <<- Y+1}}
Of course there are easier ways to accomplish the task above, but I am
more interested in how to have the "x <<- Y+1" part of the function to
change x in place for purposes of a much larger function.
I have been wrestling with
2009 Oct 11
0
[LLVMdev] Problems linking shared library with __declspec(dllexport)
> I am trying to use llvm-gcc to link shared libraries on windows/mingw32.
> When I try to link libraries that contain functions declared with
> __declspec(dllexport) someFunction();
>
> I get the link error:
>
> Cannot export _someFunction: symbol not found
dllexport declspec should be put on the function definition, in this
example there is nothing to export - dllexport
2007 Feb 28
1
problem with help.start and ?somefunction
Hi all,
I am going to be teaching a workshop next week using R and Bioconductor in one of our university's computer labs. They have recently installed R 2.4.1 for me, and I'm checking all my scripts. I just noticed that using the ?somefunction call to access the documentation for that function is not working. On my own PC, the ? call output changed between R 2.3 and 2.4; before it would
2001 Nov 27
3
Equations as arguments to functions
I am trying to pass an equation as an arguement to a function, which seems
pretty straightforward given lazy evaluation.
I constructed the following little test to make sure I sort of knew what I
was doing:
go <- function(X,eq) { C <<- X*2; d <<- eq}
a _ rnorm(100)
go(10,eq=a[.5*length(a)]+C+1)
> C
[1] 20
> d
[1] 21.10551
> a[.5*length(a)]
[1] 0.1055086
Everything