easystats / easystats/datawizard

Some minor (but breaking) suggestions for `categorize()`

Open
#709 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
238
Forks
18
Avg merge
1d 15h
Merged PRs (30d)
4

Description

  1. Current behavior is to return an integer vector. To be consistent with cut(), and to be safer to use, I think this function should return by default a factor - possible an ordered factor.
    • also I think we can drop the lowest argument?
  2. The breaks argument in R is usually used to provide the breaking values - here if those are done manually, they are sent to split instead.
  3. Rename split to method?
    1. We should add a right = TRUE argument, like with cut().

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the categorize() entry point and compare its current arguments and return behavior with R's cut(). The issue proposes several breaking API changes but names no files or tests, so first confirm which suggestions are accepted and where categorize() is tested. Done means the agreed API behavior is implemented and verified without leaving the proposal ambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.