Closed cindywen96 closed 3 years ago
i'm not sure what the issue is - this doesn't seem to be anything specific to susie but you are trying to apply colSums to a vector? That isn't allowed by colSums.
If it helps, you can avoid R automatically turning a matrix with one row into a vector by using drop=FALSE.
eg:
> x = matrix(0,nrow=1,ncol=10)
> colSums(x)
[1] 0 0 0 0 0 0 0 0 0 0
> colSums(x[1,])
Error in colSums(x[1, ]) :
'x' must be an array of at least two dimensions
> colSums(x[1,,drop=FALSE])
[1] 0 0 0 0 0 0 0 0 0 0
oh sorry, i think i see now: you are saying susie_get_posterior_mean error
has this problem when include_idx
is a single number? I'll fix this.
Thank you for your reply! Yes that is exactly what I meant
@cindywen96 could you try the current master
? I just pushed a patch for that line ...
@stephens999 oops sorry our emails crossed. Hopefully that patch solves the problem. @cindywen96 please let us know!
@gaow Thank you-it works! It could be added to function susie_get_posteriror_sd
as well
84 this thread was very helpful. Thanks. However, I had a question when using the function
susie_get_posterior_mean
. Wheninclude_idx
is a single number, I got an errorAny idea on this?