[GenABEL-dev] descriptives.traits by.var bugs.
pirastu at burlo.trieste.it
pirastu at burlo.trieste.it
Mon Mar 7 14:36:13 CET 2011
Dear all,
I'm new to the group so I'm not sure I'm doing this correctly, so if I'm
not please tell me so.
Anyways I think I found how to fix the problems with descriptives.traits:
1) descriptives.trait with missings in by.var argument
this line is causing the problem
if (!is.numeric(ctrao) | all(ctrao == svar))
it should be like this:
if (!is.numeric(ctrao) | all(ctrao == svar,na.rm=T))
2) descriptives.trait can not see the variable in by.var argument unless
full path specified.
the line
svar <- by.var
and could be modified with these 3 lines:
if(is.character(by.var) & length(by.var)==1){ svar <- data[,by.var]} #in
this case by.var should be specified as ie. "sex"
if(is.vector(by.var)){ svar <- by.var }# in this case by.var should be
like phdata(ge03d2ex)$sex
if(is.formula(by.var)){ svar <- data[,as.character(by.var)[2]]} #in this
case by.var should have the form ie. ~sex
I hope I could be of help. Sorry if I did not do things the right way.
Best
Nicola
More information about the genabel-devel
mailing list