inspectdf icon indicating copy to clipboard operation
inspectdf copied to clipboard

Bug: `inspect_num()` not able to deal with different ranges in `df2`

Open RoelVerbelen opened this issue 11 months ago • 0 comments

Hi Alastair,

I ran into this issue where inspect_num() is not able to handle cases when the numeric variable has a different range in the comparison data set df2. It seems the histogram breaks are computed on the range seen in df1 alone and then applied to df2 rather than computed on the range of df1 and df2 jointly.

Here's a minimal reprex:

library(inspectdf)
data("starwars", package = "dplyr")
starwars1 <- starwars[, "height"]
starwars2 <- starwars[, "height"] + 100
inspect_num(starwars1, starwars2)
#> Error in hist.default(col_i, plot = FALSE, right = TRUE, breaks = hist_breaks): some 'x' not counted; maybe 'breaks' do not span range of 'x'

Created on 2023-07-07 with reprex v2.0.2

RoelVerbelen avatar Jul 07 '23 08:07 RoelVerbelen