0

I am comparing two 'mean'(or average) calculation results, calculated by excel and R respectively, I found out that results is different under 4th decimal points.

I am trying to figure out the reason, and I found out that R rounds the summed value to 4th decimal places.

Is there any way to make R NOT to rounds the value?

Thank you.

YSChoi
  • 9
  • 2
  • 4
    Is R rounding the value or is R displaying the value rounded but storing it correctly? Can you provide a reproducible example? – Paul Stafford Allen Jun 07 '23 at 08:27
  • 2
    I don't believe R actually rounds the value, it just limits how many decimal places it prints. You can change this using e.g. `options(digits = 10)` in the console. See also: https://stackoverflow.com/questions/66025679/sum-of-column-rounds-decimals – nrennie Jun 07 '23 at 08:29

1 Answers1

0

You can try this when printing the result (assuming it's numeric double)

print(result, digits=5)
Abdullah Faqih
  • 116
  • 1
  • 7