ukb_gen_excl_to_na: Inserts NA into phenotype for genetic metadata exclusions

View source: R/metadata.R

ukb_gen_excl_to_naR Documentation

Inserts NA into phenotype for genetic metadata exclusions

Description

\lifecycle

defunct

Replaces data values in a vector (a UKB phenotype) with NA where the sample is to-be-excluded, i.e., is either a UKB recommended exclusion, a heterozygosity outlier, a genetic ethnicity outlier, or a randomly-selected member of a related pair.

Usage

ukb_gen_excl_to_na(data, x, ukb.id = "eid", data.frame = FALSE)

Arguments

data

A UKB dataset created with ukb_df.

x

The phenotype to be updated (as it is named in data) e.g. "height"

ukb.id

The name of the ID variable in data. Default is "eid"

data.frame

A logical vector indicating whether to return a vector or a data.frame (header: id, meta_excl, pheno, pheno_meta_na) containing the original and updated variable. Default = FALSE returns a vector.

See Also

ukb_gen_write_plink_excl

Examples

## Not run: 
my_ukb_data$height_excl_na <- ukb_gen_excl_to_na(my_ukb_data, x = "height")

## End(Not run)

kenhanscombe/ukbtools documentation built on Feb. 25, 2023, 8:37 a.m.