ashr icon indicating copy to clipboard operation
ashr copied to clipboard

Error in evaluating the argument 'x'

Open xueweic opened this issue 11 months ago • 3 comments

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

xueweic avatar Mar 13 '24 19:03 xueweic

@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 avatar Mar 13 '24 21:03 pcarbo

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

pcarbo avatar Mar 13 '24 21:03 pcarbo

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

xueweic avatar Mar 13 '24 21:03 xueweic