-
Notifications
You must be signed in to change notification settings - Fork 224
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
ckMeans return format is inconvenient #273
Comments
Came here to say the same thing actually. I'd prefer the same output format as https://simplestatistics.org/docs/#equalintervalbreaks, an array of break points. |
Happy to consider an alternative format as a separate function, like |
Since raising this originally I now realise that there are several possible ideal formats depending on the exact use case. Let's take the case of dividing [1,2,3, 11, 12, 13] into two bins.
For instance, choropleths and their legends are probably easiest to generate from the contiguous bin format, since each bin corresponds to exactly one colour. So maybe:
|
I've used the ckMeans function a couple of times now, and just wanted to report that the output format is pretty inconvenient for my (and, I'm guessing, others') general use case.
What I want:
ckmeans([-1, 2, -1, 2, 4, 5, 6, -1, 2, -1], 3)
)[0, 3]
)ckMeans() instead returns an array of the groups themselves (
[[-1, -1, -1, -1], [2, 2, 2], [4, 5, 6]]
) which requires a bit of fiddly manipulation to get into a more useful format. I guess the current format would be useful when your visualisation method is "draw all the values in the first group, then the next group, etc", maybe?Another possible more convenient output format would be an object, mapping value to group:
The text was updated successfully, but these errors were encountered: