| To: | s-news@lists.biostat.wustl.edu, Ronan.Bradley@ILIM.COM |
|---|---|
| Subject: | Re: generating function arguments as string |
| From: | Terry Therneau <therneau@mayo.edu> |
| Date: | Mon, 19 Jul 2004 08:26:43 -0500 (CDT) |
| Reply-to: | Terry Therneau <therneau@mayo.edu> |
A simple way to do what you ask is found in almost all the modeling
functions (lm, coxph, etc).
At the top of the function, before manipulating any arguments, you
will find the line
call <- match.call()
Then the "call" component is added to the output. It contains a copy of the
what you typed to invoke the function. So
fit <- coxph(Surv(time, status) ~ age + height, data=mydata, x=T)
The phrase
refit <- eval(fit$call)
will re-fit the model as originally specified.
fit$call
will print the original call on the screen.
Terry Therneau
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: generating function arguments as string, Dimitris Rizopoulos |
|---|---|
| Next by Date: | waldtest for cox proportional hazards, vincent vinh-hung |
| Previous by Thread: | Re: generating function arguments as string, Dimitris Rizopoulos |
| Next by Thread: | waldtest for cox proportional hazards, vincent vinh-hung |
| Indexes: | [Date] [Thread] [Top] [All Lists] |