[R] survexp - example produces error

Heinz Tuechler tuechler at gmx.at
Fri Dec 31 10:21:53 CET 2010


Dear All,

reposting, because I did not find a solution, maybe someone could 
check the example below.

It's taken from the help page of survdiff. Executing it, gives the error

"Error in floor(temp) : Non-numeric argument to mathematical function"

best regards,

Heinz

library(survival)

## Example from help page of survdiff
## Expected survival for heart transplant patients based on
## US mortality tables
expect <-
   survexp(futime ~ ratetable(age=(accept.dt - birth.dt),
                              sex=1,year=accept.dt,race="white"),
           jasa, cohort=FALSE,
           ratetable=survexp.usr)

Error in floor(temp) : Non-numeric argument to mathematical function

sessionInfo('survival')

R version 2.12.1 Patched (2010-12-18 r53869)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=German_Switzerland.1252  LC_CTYPE=German_Switzerland.1252
[3] LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C
[5] LC_TIME=German_Switzerland.1252

attached base packages:
character(0)

other attached packages:
[1] survival_2.36-2

loaded via a namespace (and not attached):
[1] base_2.12.1      graphics_2.12.1  grDevices_2.12.1 methods_2.12.1
[5] splines_2.12.1   stats_2.12.1     tools_2.12.1     utils_2.12.1
 > traceback()
2: match.ratetable(rdata, ratetable)
1: survexp(futime ~ ratetable(age = (accept.dt - birth.dt), sex = 1,
        year = accept.dt, race = "white"), jasa, cohort = FALSE,
        ratetable = survexp.usr)
 >



More information about the R-help mailing list