Re: [Rd] .Call in R

2011-11-20 Thread Raymond
I agree with Martin that this might not be suitable for a C solution. -- View this message in context: http://r.789695.n4.nabble.com/Call-in-R-tp4080721p4087141.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org

Re: [Rd] .Call in R

2011-11-18 Thread Karl Forner
Hi, A probably very naive remark, but I believe that the probability of sum( runif(1) ) = 5 is exactly 0.5. So why not just test that, and generate the uniform values only if needed ? Karl Forner On Thu, Nov 17, 2011 at 6:09 PM, Raymond gw...@mail.missouri.edu wrote: Hi R developers,

Re: [Rd] .Call in R

2011-11-18 Thread Martin Morgan
On 11/18/2011 07:08 AM, Karl Forner wrote: Hi, A probably very naive remark, but I believe that the probability of sum( runif(1) )= 5 is exactly 0.5. So why not just test that, and generate the uniform values only if needed ? My thought as well, but actually the deviates need to have

Re: [Rd] .Call in R

2011-11-18 Thread Joris Meys
Because if you calculate the probability and then make uniform values, nothing guarantees that the sum of those uniform values actually is larger than 50,000. You only have 50% chance it is, in fact... Cheers Joris On Fri, Nov 18, 2011 at 4:08 PM, Karl Forner karl.for...@gmail.com wrote: Hi, A

[Rd] .Call in R

2011-11-17 Thread Raymond
Hi R developers, I am new to this forum and hope someone can help me with .Call in R. Greatly appreciate any help! Say, I have a vector called vecA of length 1, I generate a vector called vecR with elements randomly generated from Uniform[0,1]. Both vecA and vecR are of double type.

Re: [Rd] .Call in R

2011-11-17 Thread Dirk Eddelbuettel
On 17 November 2011 at 09:09, Raymond wrote: | Hi R developers, | | I am new to this forum and hope someone can help me with .Call in R. | Greatly appreciate any help! | | Say, I have a vector called vecA of length 1, I generate a vector | called vecR with elements randomly