Re: [R] Generate random numbers under constrain

2014-11-27 Thread Mikhail Umorin
How about generating the uniform numbers sequentially and keep the running sum of all the previous numbers. At each step check if the newly generated random number plus the running sum 1 discard the number and generate a new one, repeat the condition check. If the new number plus old sum 1

[R] How to put inlined C code on a worker node?

2014-11-14 Thread Mikhail Umorin
Hello — I am using inline C functions within foreach %dopar% loop. On SMP (doParallel, doMP) it works but on MPI-based clusters (doMPI) it does’t. The reason, I think, is because the object code produced using the inline package, essentially an .so file, does not get copied onto the worker

Re: [R] How to put inlined C code on a worker node?

2014-11-14 Thread Mikhail Umorin
/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. On November 14, 2014 7:42:01 AM PST, Mikhail Umorin mike...@gmail.com wrote: Hello — I am using inline

[R] How to put inlined C code on a worker node?

2014-11-13 Thread Mikhail Umorin
Hello — I am using inline C functions within foreach %dopar% loop. On SMP (doParallel, doMP) it works but on MPI-based clusters (doMPI) it does’t. The reason, I think, is because the object code produced using the inline package, essentially an .so file, does not get copied onto the worker

[R] Problem with the number of function arguments when compiling inline functions

2013-08-05 Thread Mikhail Umorin
Hello, I get a strange compilation error when compiling a cfunction() inline when my C code functions are compiled in a list with other functions, but not when they are compiled by themselves. Here is an example: # begin test.R library(inline) a.sig - signature(a1=integer) a.body - int var

[R] having trouble installing RDieHarder

2013-06-25 Thread Mikhail Umorin
Hello, I am having trouble installing the package from CRAN. As the package compiles I get: * installing *source* package ‘RDieHarder’ ... ** package ‘RDieHarder’ successfully unpacked and MD5 sums checked checking for gcc... gcc checking for C compiler default output file name...

Re: [R] simulation from truncated skew normal

2013-06-12 Thread Mikhail Umorin
I am not aware of any such command so, I think, you may have to write one yourself: invert the CDF and use uniform random variable (runif) to sample Mikhail On Tuesday, June 11, 2013 16:18:59 cassie jones wrote: Hello R-users, I am trying to simulate from truncated skew normal

[R] How to cast a numeric argument to a two-dimensional array in an inline C function?

2013-06-12 Thread Mikhail Umorin
Hello -- For convenience, I would like to use a two dimensional array inside an inline C function. However, any numeric array in R is passed to C code as double *. So, how can I cast a (double *) to a double[][]? thank you for your time, Mikhail [[alternative HTML version deleted]]

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Mikhail Umorin
- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mikhail Umorin Sent: 06 June 2013 21:35 To: r-help@r-project.org Subject: [R] Distance-based non-parametric ANOVA Hello, I am comparing treatments by comparing within group to between group distances like

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Mikhail Umorin
I shall use this from now on. Thank you. On Friday, June 07, 2013 19:19:55 Pascal Oettli wrote: Hello, You also can use the package sos findFn('non-parametric multivariate ANOVA') Regards,Pascal 2013/6/7 Mikhail Umorin mike...@gmail.com[1] Hello, I am comparing treatments by comparing

Re: [R] Distance-based non-parametric ANOVA

2013-06-07 Thread Mikhail Umorin
Ghezzo Ph.D. Montreal - Canada From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf of Mikhail Umorin [mike...@gmail.com] Sent: Thursday, June 06, 2013 4:34 PM To: r-help@r-project.org Subject: [R] Distance-based non-parametric

[R] Distance-based non-parametric ANOVA

2013-06-06 Thread Mikhail Umorin
Hello, I am comparing treatments by comparing within group to between group distances like described in MJ Anderson. 2001. A new method for non-parametric multivariate analysis of variance. Austral Ecology 26: 32 -- 46. The idea is to find the ratio of within group sum of distance^2 to

Re: [R] speed of a vector operation question

2013-04-29 Thread Mikhail Umorin
/index.html http://wsopuppenkiste.wiso.uni-goettingen.de/ff/ff_1.0/inst/doc/ff.pdf Best Mehmet On 26 April 2013 18:12, Mikhail Umorin mike...@gmail.com wrote: Hello, I am dealing with numeric vectors 10^5 to 10^6 elements long. The values are sorted (with duplicates) in the vector (v). I am

[R] speed of a vector operation question

2013-04-26 Thread Mikhail Umorin
Hello, I am dealing with numeric vectors 10^5 to 10^6 elements long. The values are sorted (with duplicates) in the vector (v). I am obtaining the length of vectors such as (v c) or (v c1 v c2), where c, c1, c2 are some scalar variables. What is the most efficient way to do this? I am