Re: [R] Rounding of problem with sum command in R

2017-08-23 Thread Marc Girondot via R-help
Le 22/08/2017 à 16:26, niharika singhal a écrit : Hello I have a vector v=c(0.0886,0.1744455,0.1379778,0.1209769,0.1573065,0.1134463,0.2074027) when i do sum(v) or 0.0886+0.1744455+0.1379778+0.1209769+0.1573065+0.1134463+0.2074027 i am getting output as 1 But if i add them manually i get

Re: [R] Rounding of problem with sum command in R

2017-08-22 Thread John Kane via R-help
Try options(digits=12) sum(v) BTW I don't get the same value as you did when you calculated manually. On Tuesday, August 22, 2017, 10:39:26 AM EDT, Bert Gunter wrote: ... and following up on Spencer's answer, see the "digits" argument of ?options and ?print.default.

Re: [R] Rounding of problem with sum command in R

2017-08-22 Thread Bert Gunter
... and following up on Spencer's answer, see the "digits" argument of ?options and ?print.default. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

Re: [R] Rounding of problem with sum command in R

2017-08-22 Thread Spencer Graves
On 2017-08-22 9:26 AM, niharika singhal wrote: Hello I have a vector v=c(0.0886,0.1744455,0.1379778,0.1209769,0.1573065,0.1134463,0.2074027) when i do sum(v) or 0.0886+0.1744455+0.1379778+0.1209769+0.1573065+0.1134463+0.2074027 i am getting output as 1 No:  That's only the display:

[R] Rounding of problem with sum command in R

2017-08-22 Thread niharika singhal
Hello I have a vector v=c(0.0886,0.1744455,0.1379778,0.1209769,0.1573065,0.1134463,0.2074027) when i do sum(v) or 0.0886+0.1744455+0.1379778+0.1209769+0.1573065+0.1134463+0.2074027 i am getting output as 1 But if i add them manually i get 1.0026 I do not want to round of my value since