detectSex {DDM}R Documentation

Detect the sex for some demographic data

Description

The column name can be "sex" or "Sex" and nothing else. If coded with integer, the number 1 is recognized as male and numbers, 0, 2, or 6 are assumed to be female. Any other integer will throw an error. If character, if the first letter is "f", then we assume female, and if the first letter is "m" we assume male. Case does not matter. Anything else will throw an error. This function allows for just a little flexibility.

Usage

detectSex(Dat, sexColumn = "Sex")

Arguments

Dat

a data.frame containing a column called Sex, or codesex.

sexColumn

character string giving the name of the Sex column "Sex" assumed.

Value

either "f" or "m"


[Package DDM version 1.0-0 Index]