[R] R-help

Ariadna García Sáenz quiro3 at msn.com
Mon May 18 13:32:20 CEST 2015

Good afternoon,
I'm working in a disease spread model, and I have to use a function to put information on a table.
My question is that I don't know how to get the output of this function in a table. Thanks in advance!
Here I paste my script:
tbmodel <- function(time,S,E,I,De,Di,beta,alpha,phi,rho){  ts <- data.frame(time=sim.time,S=susceptibles,E=exposed,I=infectious,De=De,Di=Di)  next.time <- ts  while(next.time$time<limit.time&next.time$S>0&next.time$E>=0&next.time$I>=0) # Conditions under which within-herd spread continues  {    next.time <-gillespie(next.time$time,next.time$S,next.time$E, next.time$I,next.time$De,next.time$Di,beta,alpha,phi,rho)    ts <- rbind(ts,next.time)    if(ts$time[nrow(ts)]>limit.time|ts$E[nrow(ts)]<0)ts <- ts[-nrow(ts),]  # Elimination of last column (time> limit.time)  }

	[[alternative HTML version deleted]]

More information about the R-help mailing list