The zygocity calculations are different depending on wheather both twins have answered the questionnaire or not. This convenience function help determine, based on the column coding for twin pairs, if one or two twins are present in the data with complete viable data. If both twins are in the data, but one twin has incomplete data, the function will return "single" for the remaining twin.

zygo_type(data, twin_col, cols = starts_with("zygo"))

Arguments

data

dara.frame with the relevant data

twin_col

column that codes for twin pairs. Each twin should have the same identifier here.

cols

columns that contain the zygocity data. Use tidy-selectors

Value

full data frame with twin type appended