liud4 / rVMAP

Data Management code for VMAC-MAP study
Other
3 stars 0 forks source link

add derived 4 levels of alleles group #31

Closed liud4 closed 4 years ago

liud4 commented 4 years ago

Omair,

Could we add the four levels of allele group in the merged dataset? Here is the code I used in a project. I am sure you have a similar code in one of your project too. Please note the variable name "allelles" was corrected to "alleles".

smalldat$allelles.factor<-factor(ifelse(smalldat$allelles%in%c('E2/E2', 'E2/E3'), 'E2/E2, E2/E3', 
                                        ifelse(smalldat$allelles%in%c('E3/E4', 'E4/E4'), 'E3/E4, E4/E4',
                                               smalldat$allelles)))
smalldat$allelles.factor<-relevel(smalldat$allelles.factor, ref='E3/E3')

https://github.com/liud4/rVMAP/blob/8caca2df7692774cee60fc4987182d3676d106eb/R/derive_apoe.R#L7