Skip to content
Back to formatted view

Raw Message

Message-ID: <20051203090144.M92668@cc.kmu.edu.tw>
Date: 2005-12-03T09:23:35Z
From: Chun-Ying Lee
Subject: How to catch value

Dear R users:
I have a problem about catch the value from function.
I have following two functions (part):
fbolus1 <- function()
{.........
 par<-data.frame(Parameter=c("kel","Vd"),Initial=c(0))  
 check(par)
 .....}
check<-function(par)
{
 if (par[ ,2] <= 0){
 cat("\nEnter again (y/n) ?\n\n")
 ans<-readline()
   if (ans == "n" ){
     return(tidy.up()) 
  }
  else{
     cat("\n")
     par<-edit(par)
  }
 }
}  
 
I wonder if it is possible to catch the value ("par" in this example) which
"check" function generated and than go back to the "fbolus1" function,  and
keep executing the command next to "check(par)", and "fbolus1" function can 
accept the value "check" function generated. If it is possible, please give me
some comments. Thanks in advance !!