Re: [R] Error in if (!length(fname) || !any(fname == zname)) { :

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri, 04 May 2007 11:55:56 +0100 (BST)

I suggest reading the chapter on debugging in 'Writing R Extensions' and using the tools described there (such as options(error=recover)) would be at least as effective. Even traceback() would have helped the readers.

Note that there is no function 'cph' in R: presumably we are supposed to guess this is about package Design.

On Fri, 4 May 2007, Vladimir Eremeev wrote:

>
> For me, the simplest way to find, what is wrong, would be tracing the R code:
>
> library(debug)
> mtrace(cph)
> cph(Surv(time.sur, status.sur)~ strat(colon[,13])+colon[,18]
> +colon[,20]+colon[,9], surv=TRUE)
>
> ... then find the place of the error and analyze how to adjust the function
> call arguments to avoid the error and get the desired result.

Hmm, and then undo the effects ...

>
> hongyuan cao wrote:
>>
>> I tried to fit a cox proportional hazard model to get estimation of
>> stratified survival probability. my R code is as follows:
>>
>> cph(Surv(time.sur, status.sur)~ strat(colon[,13])+colon[,18]
>> +colon[,20]+colon[,9], surv=TRUE)
>> Error in if (!length(fname) || !any(fname == zname)) { :
>> missing value where TRUE/FALSE needed
>> Here colon[,13] is the one that I want to stratify and the others are all
>> coefficients. How can I solve this problem? Thanks a lot!!!!!
>>
>> Grace
>>
>
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 04 May 2007 - 11:05:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 May 2007 - 12:31:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.