kbroman / qtl

R/qtl: A QTL mapping environment
https://rqtl.org
GNU General Public License v3.0
77 stars 45 forks source link

stepwiseqtl requires covar argument to be a data frame #39

Closed kbroman closed 9 years ago

kbroman commented 9 years ago

stepwisecovar seems to take the covariate names from names(covar). If covar is a matrix and not a data frame, this returns NULL, and so no covariates get included in the analysis.

We should convert to a data frame in this case

data(hyper)
hyper <- calc.genoprob(hyper)
x <- matrix(rnorm(nind(hyper)*2), ncol=2)
# no covariates will be included:
z <- stepwiseqtl(hyper, covar=x, method="hk", max.qtl=2)

x <- as.data.frame(x)
# now the covariates will be included:
z <- stepwiseqtl(hyper, covar=x, method="hk", max.qtl=2)
kbroman commented 9 years ago

Fixed in this commit.