Re: [R] how to save output all together

From: Ales Ziberna <>
Date: Mon 05 Dec 2005 - 20:10:23 EST

See the corrections in your first function!

Hope it helps,
Ales Ziberna
----- Original Message -----
From: "Chun-Ying Lee" <> To: <>
Sent: Monday, December 05, 2005 2:49 AM
Subject: [R] how to save output all together

Dear R users:

I have a problem about catch the value from function. I have following two functions (part):

sbolus1 <- function()


  PKindex<-<-vector(Subject,mode="list")   #creates a list to save outputs of individual calls to your function   for( i in 1:Subject) {
  PKindex[[i]]<-sbolus1.out(PKtime,kel,Vd,defun,par1,par2,Dose,i)   #saves an output of the current call to the function in an apporapriate place in the list


  C1.lsoda<-data.frame(lsoda(Dose/Vd,c(0,time),defun,parms))   cat("\n")
  dimnames(sim)<-list(c("kel","Vd"),c("Value","Original"))   show(sim)
  cat("\n\n<< Output >>\n\n")
good<-ifelse(C1.lsoda[2:(length(time)+1),2]<=0,0,C1.lsoda[2:(length(time)+1),2])   PKindex<-data.frame(i,C1.lsoda[2:(length(time)+1),1],good)   colnames(PKindex)<-list("Subject","time","conc")   show(PKindex)

In each loop, it can generate one PKindex(consisting of subject , time and concentration), and I want to save all the PKindex together. But in the command I wrote, I just can save the last one. For example, if i=2, I just save the data of subject 2. Please give me some comments about the problem. Thanks in agvance !! mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Mon Dec 05 20:20:59 2005

This archive was generated by hypermail 2.1.8 : Mon 05 Dec 2005 - 23:30:44 EST