[R] str and Surv objects
Martin Maechler
maechler at stat.math.ethz.ch
Wed Aug 11 08:33:11 CEST 2004
>>>>> "AndyL" == Liaw, Andy <andy_liaw at merck.com>
>>>>> on Tue, 10 Aug 2004 22:19:23 -0400 writes:
AndyL> Buried in str.default is a line:
AndyL> iv.len <- round(2.5 * v.len)
AndyL> which seems to be the culprit. v.len is 4, which
AndyL> seems correct for the data given. Why multiply by
AndyL> 2.5?
because 'v.len' is the length to use for 'double'
'iv.len' is the one to use for 'integer' (*iv* = integer vector).
2.5 is a fudge factor determined `by experience, examples, trial
and error'
I'll fix this bug differently (than not using '2.5*' ).
Martin Maechler
AndyL> Andy
>> From: Laura Holt
>>
>> Dear R People:
>>
>> I used the "Surv" function to produce the following object:
>> >a <- Surv(1:4,2:5,c(0,1,1,0)) a
>> [1] (1,2+] (2,3 ] (3,4 ] (4,5+]
>> >str(a)
>> Error in "[.Surv"(object, 1:ile) : subscript out of bounds
>> >
>>
>> Why does str(a) give an error, please? Or did I do something wrong?
>>
>> Thanks in advance.
>> R Version 1.9.1 Windows
>> Sincerely,
>> Laura Holt
>> mailto: lauraholt_983 at hotmail.com
>>
>>
>> ______________________________________________
>> 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
>>
>>
AndyL> ______________________________________________
AndyL> R-help at stat.math.ethz.ch mailing list
AndyL> https://stat.ethz.ch/mailman/listinfo/r-help
AndyL> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list