You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/checkSex.R
+81-35Lines changed: 81 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,14 @@
17
17
#'
18
18
#' @details This function uses the terms 'male' and 'female' in a biological context, referring to chromosomal and other biologically-based characteristics necessary for constructing genetic pedigrees. The biological aspect of sex used in genetic analysis (genotype) is distinct from the broader, richer concept of gender identity (phenotype).
19
19
#'
20
-
#' We recognize the importance of using language and methodologies that affirm and respect the full spectrum of gender identities.
20
+
#' We recognize the importance of using language and methodologies that affirm and respect the full spectrum of gender identities.
21
21
#' The developers of this package express unequivocal support for folx in the transgender
22
22
#' and LGBTQ+ communities.
23
23
#'
24
24
#' @param ped A dataframe representing the pedigree data with a 'sex' column.
25
25
#' @param code_male The current code used to represent males in the 'sex' column.
26
26
#' @param code_female The current code used to represent females in the 'sex' column. If both are NULL, no recoding is performed.
27
+
#' @param code_unknown The current code used to represent unknown or ambiguous sex in the 'sex' column. Can be NA to indicate that missing values should be treated as unknown. If NULL and both code_male and code_female are provided, values not matching either will be inferred as unknown.
27
28
#' @param verbose A logical flag indicating whether to print progress and validation messages to the console.
28
29
#' @param repair A logical flag indicating whether to attempt repairs on the sex coding.
29
30
#' @param momID The column name for maternal IDs. Default is "momID".
#' @param recode_na The value to use for missing values. Default is NA_character_
143
158
#' @param recode_male The value to use for males. Default is "M"
144
159
#' @param recode_female The value to use for females. Default is "F"
160
+
#' @param recode_unknown The value to use for unknown values. Default is "U"
145
161
#' @inherit checkSex details
146
162
#' @return A modified version of the input data.frame \code{ped}, containing an additional or modified 'sex_recode' column where the 'sex' values are recoded according to \code{code_male}. NA values in the 'sex' column are preserved.
0 commit comments