stephens999 / ashr

An R package for adaptive shrinkage
GNU General Public License v3.0
79 stars 35 forks source link

Error in evaluating the argument 'x' #141

Open xueweic opened 6 months ago

xueweic commented 6 months ago

Hi there,

Hope everything is well. I met an issue when I run ash function with input z. Here, z is a P by 1 vector of z-score. Do you have any idea for this error? Thank you.

ashr::ash( z, rep(1,length(z)),mixcompdist = "normal" )

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 't': error in evaluating the argument 'x' in selecting a method for function 't': non-conformable arrays

ashr::ash( z, rep(1,length(z)) )

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 't': argument is not a matrix

pcarbo commented 6 months ago

@xueweic The likely issue is that z is not a vector. If it is a matrix something like this should work:

res <- ash(drop(z), rep(1,length(z)))
pcarbo commented 6 months ago

(Apologies that the error message is not more helpful.)

xueweic commented 6 months ago

@pcarbo Thanks Peter, drop(z) solve the issue. z is an matrix-like vector with dimension of P by 1.