| To: | Splus user group <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | If-then statement |
| From: | Helen Chang <helen.chang@cognigencorp.com> |
| Date: | Wed, 14 Jul 2004 06:59:47 -0400 |
Hi, All:
I am trying to modify this one standard expression to accomodate the
if-then statements. But I got syntax error after I did that. Below are
the codes
1.Standard expression:
form<-expression((1/v*ka)/(ka-ke)*(exp(-ke*(t-tlag))-exp(-ka*(t-tlag))))
2. The if-then expression:
model1 <- if (0<=t<=tlag) {
((1/v*ka)/(ka-ke)*(exp(-ke*t)-exp(-ka*t)))}
model2 <- else {
((1/v*ka)/(ka-ke)*(exp(-ke*(t-tlag))-exp(-ka*(t-tlag))))}
form<-c(expression(model1),expression(model2))
Any suggestion will be greatly appreciated.
Thank you.
Helen
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | legend color in finmetrics, Ruud H. Koning |
|---|---|
| Next by Date: | Re: shorter command?, Kington, Marit *HS |
| Previous by Thread: | legend color in finmetrics, Ruud H. Koning |
| Next by Thread: | (non)-evaluation of an optional argument, Patrick Joseph |
| Indexes: | [Date] [Thread] [Top] [All Lists] |