tomast80 4211
Postad: 30 dec 2022 18:12

Avrundning i R

Hej!

Det verkar som att funktionen round i R avrundar till närmsta jämna tal, se nedan. Är inte standard annars att avrunda .5 uppåt till närmsta heltal? Så funkar det väl i excel t.ex.?

fner 927
Postad: 30 dec 2022 18:29

"Note that for rounding off a 5, the IEC 60559 standard is expected to be used, ‘go to the even digit’. Therefore round(0.5) is 0 and round(-1.5) is -2." Källa

Laguna Online 28548
Postad: 30 dec 2022 18:33

Man ska inte räkna med att Microsoft har gjort nånting rätt.

Svara Avbryt
Close