I have a "result":

> hazards
        (60, 70]    (70, 80]    (80, 90]   (90, 100]
[1,] 0.046612937 0.115643783 0.273613266 0.450127975

Two issues: (i) Too many decimals, and (ii) it seems to be an 1x4 matrix, I only need the first row. (i):

> haz <- round(hazards, 3)
> haz
     (60, 70] (70, 80] (80, 90] (90, 100]
[1,]    0.047    0.116    0.274      0.45

As expected, the fourth element lost a trailing zero. I'll deal with that, but first (ii):

> haz[1, ]
 (60, 70]  (70, 80]  (80, 90] (90, 100]
    0.047     0.116     0.274     0.450

And the trailing zero is mysteriously recovered!

Is there some general rule governing this behaviour?

Thanks, Göran

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to