Re: [R] Simulating a Poisson Process in R by calling C Code over .Call

2010-06-13 Thread Thomas Lumley
On Sun, 13 Jun 2010, Fabian Zäpernick wrote: Hi I want to write a C function for the R Code below and call it with .Call: SimPoisson <- function(lambda,tgrid,T2M) #Simulation eines Poissonprozesses return(list(NT=NT,Ni=Ni,tau=tau)) } I read the manual "writing R extensions" over an

[R] Simulating a Poisson Process in R by calling C Code over .Call

2010-06-13 Thread Fabian Zäpernick
Hi I want to write a C function for the R Code below and call it with .Call: SimPoisson <- function(lambda,tgrid,T2M) #Simulation eines Poissonprozesses { NT <- 0 Ni <- rep(0,length(tgrid)) tau <- 0 sign <- 0 if(lambda != 0) { i=1