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)
stepwisecovar
seems to take the covariate names fromnames(covar)
. Ifcovar
is a matrix and not a data frame, this returnsNULL
, and so no covariates get included in the analysis.We should convert to a data frame in this case