R doesn't round the way you think it does
I can't tell you how much time I've spent thinking about rounding in R. Rounding, you ask? Yep! Rounding in R can be confusing because the way R rounds numbers is different than what you might expect. Here's how it works!
Code shown in video
round(x = 11.5, digits = 0)
round(x = 12.5, digits = 0)
library(janitor)
round_half_up(x = 11.5, digits = 0)
round_half_up(x = 12.5, digits = 0)
Sign up for the newsletter
Get blog posts like this delivered straight to your inbox.
You need to be signed-in to comment on this post. Login.