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

Convert binary values to TRUE/FALSE #12

Closed
DesiQuintans opened this issue Jul 24, 2023 · 1 comment
Closed

Convert binary values to TRUE/FALSE #12

DesiQuintans opened this issue Jul 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@DesiQuintans
Copy link
Owner

DesiQuintans commented Jul 24, 2023

The package already has a way to convert variables to Factors, but it also needs a way to convert variables to Logical (TRUE/FALSE). It should not be based on making yet another file; it should either be:

  1. A new column in index.tsv that flags a variable to be converted to Logical
  2. A keyword that you can type into the existing factor_file column that overrides the file search and triggers the conversion.

Maybe #2 is better because it also lets me scale into other built-in converters? See #13.

@DesiQuintans
Copy link
Owner Author

DesiQuintans commented Dec 5, 2023

Closed by commit 5c0c758. This was implemented as "converters" that are triggered by using the converter tags:

  • <truefalse> — Converts truthy values to TRUE, falsy values to FALSE, everything else (including NA) to NA.
  • <truefalse-lazy> — Converts truthy values to TRUE and everything else to FALSE, but preserves NA as NA.
  • <yesno> — Converts truthy values to factor level "Yes", falsy values to factor level "No", and everything else (including NA) to NA. "Yes" is the first factor level.
  • <noyes> — Same as above, but with "No" as the first factor level.
  • <yesno-lazy> — Converts truthy values to factor level "Yes" and everything else to factor level "No", but preserves NA as NA. "Yes" is the first factor level.
  • <noyes-lazy> — Same as above, but with "No" as the first factor level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant