hibayes icon indicating copy to clipboard operation
hibayes copied to clipboard

Error in as.vector(data) : no method for coercing this S4 class to a vector

Open wtchoga opened this issue 5 years ago • 3 comments

Hi Li

I am getting this error: Error in as.vector(data) : no method for coercing this S4 class to a vector; when I try to run

pve <- apply(geno,2,var) * (fit$g^2) / var(pheno[,1]).

Can you please advise.

wtchoga avatar Nov 28 '20 06:11 wtchoga

Thanks for using hibayes. Please try pve <- apply(as.matrix(geno),2,var) * (fit$g^2) / var(pheno[,1]).

YinLiLin avatar Nov 28 '20 07:11 YinLiLin

fit <- bayes(y=pheno[, 1], X=geno, map=map, windsize=1e6, wppa=0.01, model="BayesCpi", niter=20000, nburn=10000, outfreq=10) Error in bayes(y = pheno[, 1], X = geno, map = map, windsize = 1e+06, : Factors or characters are not allowed in physical position.

wtchoga avatar Nov 29 '20 08:11 wtchoga

If you are trying to do GWAS using Bayes model, please make sure that all the physical positions in the map information should be in digital values, any character is unacceptable.

YinLiLin avatar Dec 03 '20 04:12 YinLiLin