zygo_type: Find how many twins have answered

View source: R/zygocity-funcs.R

zygo_typeR Documentation

Find how many twins have answered

Description

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.

Usage

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


LCBC-UiO/Questionnaires documentation built on July 18, 2023, 6:45 p.m.