Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

high precision numerics cause binr::bins to error ? #5

Open
nir4most opened this issue Jul 6, 2020 · 0 comments
Open

high precision numerics cause binr::bins to error ? #5

nir4most opened this issue Jul 6, 2020 · 0 comments

Comments

@nir4most
Copy link

nir4most commented Jul 6, 2020

Here is a reprex showing that with rounding this vector can be binned by binr, but not without...

library(binr)
library(purrr)
pvs <-c(-0.833333333333333, -0.666666666666667, -0.5, -0.333333333333333, 
        -0.166666666666667, 0, 0.166666666666667, 0.333333333333333, 
        0.5, 0.666666666666667, 0.833333333333333, 1, 1.66666666666667, 
        1.83333333333333, 2.16666666666667)

map(1:20,
   ~tryCatch(expr = binr::bins(
       round(problem_vec_s,.x),
       target.bins = 3 ,
       max.breaks = 4 ,
       exact.groups = T
   )$binct ,error = function(e) e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant