Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TADA_ThresholdFlag #690

@jbousquin

Description

@jbousquin

TADA_FlagBelowThreshold() [615-816] & TADA_FlagAboveThreshold() [408-611] are very similar, just with one comparing on < and the other >. Each function should do one thing well - but this seems like an opportunity to reduce duplicative code. The other thing that isn't clear to me is how to flag both - as when I flag one it drops the existing flag column.

'Flag' is also a bit of a misnomer being that the function will flag/filter/clean.

One option would be an arg with 3 acceptable params [Below/Above/Between]. Maybe shorten to TADA_Thresholds()? Not sure how R does with that since the boolean logic makes me think you have tried to avoid args like that?

Another option would be to add an internal function that does all the work and keep the current two as is, passing the internal function info specific to above/below, thus letting users interact with it the way it is (v1.0 suggests some stability).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions