Potential Rounding Causing Unexpected Boolean Results

I am having an issue with two double columns that are not resulting in the expected result. The data that is displayed using pull() yields a double scalar-value of 0.1 for both columns a and b. The expected result of a > b should be FALSE, but is resulting in TRUE.

I have tried troubleshooting to see what the values in the data frame explicitly are, but everything prints as 0.1. What functions can I use to help determine if there's a rounding error going on?

tibble %>%
summarize(max_a = max(a), max_b = max(b)) %>%
mutate(tf = max_a < max_b)

class(your_tibble) and make sure that both columns are dbl is the first step. The second step is to make sure that the function on the objects doesn't have a rounding default.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.