Re: [R] round and trailing zero

2024-07-30 Thread Göran Broström
Den 2024-07-30 kl. 17:09, skrev Jorgen Harmse: Duncan Murdoch answered your question, but I have another. Are you going to do some computation with the rounded numbers, Wouldn't dream of it. or are they just for display? Yes. G, (One thing I like about Excel is that I can change the

Re: [R] round and trailing zero

2024-07-30 Thread Jorgen Harmse via R-help
Duncan Murdoch answered your question, but I have another. Are you going to do some computation with the rounded numbers, or are they just for display? (One thing I like about Excel is that I can change the display format of a cell without changing answers that depend on that cell.) In the latte

Re: [R] round and trailing zero

2024-07-29 Thread Göran Broström
Ah, thanks, Göran > 29 juli 2024 kl. 16:23 skrev Duncan Murdoch : > > On 2024-07-29 10:06 a.m., Göran Broström wrote: >> 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

Re: [R] round and trailing zero

2024-07-29 Thread Duncan Murdoch
On 2024-07-29 10:06 a.m., Göran Broström wrote: 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):

[R] round and trailing zero

2024-07-29 Thread Göran Broström
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,