From 097cdf0a1b2fa1ab4d0fd6f5340c1e649b08a26a Mon Sep 17 00:00:00 2001 From: eleanorsanderson Date: Mon, 13 Jan 2025 13:24:31 +0000 Subject: [PATCH] correcting typos --- resources/phenotypes/phenotype_functions.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/phenotypes/phenotype_functions.R b/resources/phenotypes/phenotype_functions.R index 44650a5..6e7c5a9 100755 --- a/resources/phenotypes/phenotype_functions.R +++ b/resources/phenotypes/phenotype_functions.R @@ -647,9 +647,9 @@ organise_phenotype <- function(phecode, phenotypes, df, gen_covs, covdat, agebin } #select these observations from the original data and remove - covs <- analysis_dat %>% - select(all_of(c(names(gen_covs), cov_ids))) %>% + covs <- analysis_data %>% filter(agebin == age_group) %>% + select(all_of(c(names(gen_covs), cov_ids))) %>% filter(IID %in% pheno_out$IID) %>% filter(!duplicated(paste(FID, IID))) @@ -759,9 +759,9 @@ organise_phenotype <- function(phecode, phenotypes, df, gen_covs, covdat, agebin if(phecode == "bmiz"){ cov_ids <- "sex" } - covs <- analysis_dat %>% + covs <- analysis_data %>% + filter(lsbin == age_group) %>% select(all_of(c(names(gen_covs), cov_ids, "age"))) %>% - filter(agebin == age_group) %>% filter(IID %in% pheno_out$IID) %>% filter(!duplicated(paste(FID, IID)))