Displaying 20 results from an estimated 1000 matches similar to: "combn implementation"
2004 May 03
2
adding a method to the dist function
Hi all,
I'd like to add the Bhattacharyya method to the dist function.
What is the best way to do this? I'm using R 1.9.0 and I was looking
for the code that defines the already existing distances, but I didn't
manage. As far as I understand, dist is defined in mva that is part
of the stats package now, but where is the code?
Thank you very much,
Giampiero
2004 Jan 16
2
reference to objects
Hi,
is there a way to reference to a data object without copying it?
For example I have a huge matrix called dist and I want two objects
obj1 and obj2 to have a memeber dist that points to the matrix, but
I don't want, for memory reasons, to copy the matrix twice.
As far as I understand the following code will generate three copies
of my data:
dist <- some_code_that_generates_data
2010 Mar 26
2
More efficient alternative to combn()?
Hi,
i am working on a problem where i need to compute the products of all
possible combinations of size m of the elements of a vector. I know that
this can be achieved using the function combn(), e.g.:
> vector <- 1:6
> combn(x = vector, m = 3, FUN = function(y) prod(y))
In my case the vector has 2000 elements and i need to compute the values
specified above for m = 32. Using combn() i
2012 Nov 16
1
pairing data using combn with criteria
Dear All,
I have a dataframe made up of individual beetles consisting of individual
number, family number, mother's family number, father's family number, and
sex of the beetle. I would like to pair up the individuals for breeding. I
would, however, like to avoid breeding beetles of the same sex (obviously),
the same family, and with the same mother's family or father's family,
2010 Apr 07
1
combn with factors
Dear list,
I have come across this issue:
combn(letters[1:5], 3)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] "a" "a" "a" "a" "a" "a" "b" "b" "b" "c"
[2,] "b" "b" "b" "c" "c" "d" "c"
2011 Oct 16
1
multicore combn
This is a 'rather than re-invent the wheel' post. Has anyone out there
re-written combn so that it can be parallelized - with multicore, snow, or
otherwise? I have a job that requires large numbers of combinations, and
rather than get all of the index values, then crank it through mclapply, I
was wondering if there was a way to just do this natively within a function.
Just curious.
2013 Jan 24
2
Please help R error message "masked from 'package:utils':combn"
Hi
The message occurred from R, when I was selected of "optimization > block
diagonal Fhiser matrix" and used the attached file on PFIM.
Could you please advise me about the following message?
*****************************
Loading required pakage: combinat
Attaching package:'combinat'
The following object(s) are masked from 'package:utils':combn
2006 May 09
1
combn(n, k, ...) and all its re-inventions
It seems people are reinventing the wheel here:
The goal is to generate all combinations of 1:n of size k.
This (typically) results in a matrix of size k * choose(n,k)
i.e. needs O(n ^ k) space, hence is only applicable to
relatively small k.
Then alternatives have been devised to generate the combinations
"one by one", and I think I remember there has been a
quiz/challenge about 20
2011 Jan 10
1
Using combn
Dear list,
I want to apply the "table" function to every pair of variables in df
and the return should be a list.
setwd(123)
asd <- data.frame(a1=sample(1:4, 20, replace=TRUE),
a2=sample(1:4, 20, replace=TRUE),
a3=sample(1:4, 20, replace=TRUE),
a4=sample(1:4, 20, replace=TRUE))
with(asd, table(a1, a2))
with(asd, table(a1,
2008 Feb 08
2
Applying lm to data with combn
http://www.nabble.com/file/p15359204/test.data.csv
http://www.nabble.com/file/p15359204/test.data.csv test.data.csv
Hi,
I have used apply to have certian combinations, but when I try to use these
combinations I get the error
[Error in eval(expr, envir, enclos) : object "X.GDAXI" not found]. being a
novice I donot understand that after applying combination to the data I cant
access
2007 Mar 27
2
Newbie: Combn and scripting
Hello All,
I have just installed my R 2.4 (windows) as a test trying to load a data
frame and run combn() for each line into another file. How do I do this?
data.csv:
a,b,c,d
1,2,3.4
g,3,6,t
etc
x=data.csv, m=3
Thank you
Zam
_________________________________________________________________________________
This email contains confidential information intended only for the person named
2009 Sep 21
2
Combine vectors in order to form matrixes with combn
Hello!
I've a problem with the combn function and a set of vector. I
would like to make a simple combination where, instead of scalars, i
would like to combine vector, in order to form matrixes.
In other
words, i have nineteen 6-items vectors (for example coef1-coef19), that
i would like to combine in n!/k!(n-k)! 6x6 matrixes.
I tried with a
code like this
mma <-
2004 Feb 02
2
ordering in dotplot
Dear R-friends,
the dataset I am using (data.it) is organized as follows
partner stp btp reg
hk 0.64 1 s
ger 0.27 1 d
tur 0.27 1 s
rom 0.24 1 s-f
por 0.24 1 s
spa 0.23 1 s
gre 0.22 1 d-f
aus 0.17 1 d
uk 0.16 1 s
be 0.16 1 d
arg 0.15 1 s
usa 0.13 1 d-f
fra 0.13 1 s
neth
2004 Mar 19
3
how to fix a factor
Hi all,
I created a data frame with three factors, plus the response that
looks like this:
x1 x2 x3 y
a 1 1 0.3
a 2 1 0.1
b 1 1 0.4
c 4 3 0.1
...
I would like to analise the effect of two of them, keeping the third fixed
(I already know the effect of the last). The reason why I don't create several
data frames for each value of the thirs factor is simply convenience (I'd like
to be able
2007 Feb 28
1
adding graphics after dev.copy
Hi,
I am trying to create a plot and save it as pdf to the file
file1.pdf, then add some details and save the new plot as file2.pdf.
I would like to avoid repeating all the instructions needed to create
file1.pdf when I create file2.pdf.
This is what I have tried:
pdf(file="file1.pdf")
plot(1:10)
dev.copy(pdf,file="file2.pdf")
points(2,3)
dev.off()
dev.off()
When I run
2006 Dec 13
2
Phonetic symbols (IPA) in R graphics
Hi all,
I would like to add phonetic symbols in my figures. Usually I typeset
my documents in LaTeX and I use the tipa [1] package to get
International Phonetic Alphabet (IPA) fonts. So, my problem would be
solved if I could insert LaTeX commands in the text() function (I
guess at least).
I would like to avoid using psfrag (that is, inserting a string in
the eps figure and then substituting it
2007 Feb 28
1
incremental plots with pdf and dev.copy
Hi,
I am trying to produce incremental plots directly using the pdf
device. I mean that I want to produce a plot, save it in a pdf
file, then add details and save the new plot in a new file, and
so on. Before I used to do this with x11, by just adding graphics to
a plot and then using dev.copy2eps at the right times for each eps
figure. Now I want to do this in batch mode and the x11 device is not
2008 Feb 14
0
reordering combn(n,p)
I found the following slightly surprising and thought that it might
(eventually) be useful to someone to document it:
Problem: I wanted to reorder the columns of the matrix produced
by combn(n,p) so that adjacent columns only differed by one element.
I assumed that this was a problem known to the Assyrians and
resisted the temptation to write to r-help, and through assiduous
googling finally
2012 May 08
4
glmmADMB
Hi there,
I am new to the package glmmadmb, but need it to perform a zero-inflated
gzlmm with a binomial error structure. I can't seem to get it to work
without getting some strange error messages.
I am trying to find out what is affecting the number of seabird calls on an
array of recorders placed at 4 sites on 6 islands. I have nightly variables
(weather and moonlight), site variables
2006 Jun 07
2
SAR
Folks,
At what point in iowait should I start to worry about having a
bottleneck, or is this something that can't be answerd with a single
integer? According to sar, after my last reboot to turn off
hyperthreading as a test, at one time, I see 4.9% iowait, but then one
minute later, it droped back to 0.01%, and rarely even gets to 1.0%, at
least what I remember from yesterday. ?