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"))
dara.frame with the relevant data
column that codes for twin pairs. Each twin should have the same identifier here.
columns that contain the zygocity data. Use tidy-selectors
full data frame with twin type appended