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

report_participants: allow "Female" and "Male" for variable "gender" #247

Closed
rempsyc opened this issue May 7, 2022 · 0 comments · Fixed by #260
Closed

report_participants: allow "Female" and "Male" for variable "gender" #247

rempsyc opened this issue May 7, 2022 · 0 comments · Fixed by #260

Comments

@rempsyc
Copy link
Member

rempsyc commented May 7, 2022

report_participants allows Female and Male for variable sex, but not variable gender (they are currently coded as non-binary). Yet, variable gender supports the abbreviations for M and F. For consistency, it would make sense to allow their full spelling as well. Plus, some datasets do use Female and Male for variable gender (regardless of one's opinion on whether this is appropriate). It is not a big deal to recode it manually in our own script, but it would be a nice and easily implementable convenience to support this.

Desired updated documentation:

gender	
The name of the column containing the gender of the The [delete typo] classes should 
be one of c("Man", "M", "Male", "Woman", "F", "Female", "Non-Binary", "N"). Note that 
you can specify other characters here as well (e.g., "Gender Fluid"), but the function 
will group all individuals in those groups as "Non-Binary".

Edit

Actually, it seems that (despite the documentation), "M" for "Man" is supported, but "F" for "Female" is not (only "W" for "Woman" is). Demo:

library(report)
data <- data.frame(
  "Age" = c(22, 23, 54, 21, 8, 42),
  "Sex" = c("Intersex", "F", "M", "M", "M", "F"),
  "Gender" = c("N", "F", "F", "M", "M", "M")
)
report_participants(data)
"6 participants (Mean age = 28.3, SD = 16.6, range: [8, 54]; Sex: 33.3% females, 50.0% males, 16.7% other; Gender: 0.0% women, 50.0% men, 50.00% non-binary)"
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

Successfully merging a pull request may close this issue.

1 participant