EMCluster
EMCluster copied to clipboard
Inst_workflow error: Error in if (class(tmp) == "try-error") { : the condition has length > 1
Hi, I am new to EMCluster so first trying out the example workflow. I tried all workflows, and found out that the code below cause error.
for(k.var in 1:dim(var)[3]){
# Check degenerate.
tmp <- try(solve(var[,, k.var]), silent = TRUE)
if(class(tmp) == "try-error"){
flag <- 1
break
}
}
Error in if (class(tmp) == "try-error") { : the condition has length > 1
I figured out that the classes of the object tmp are "matrix" and "array", which generates the error above. For now, I avoided the error by choosing the first class (class(tmp)[1]
) to infer "try-error" but I do think this needs improvement.
Thanks, please provide a minimum working example (MWE) so that we may find our what the source of the error is.
Thanks for the reply.
I was exactly following the inst > workflow > crabs https://github.com/snoweye/EMCluster/blob/5b8526937fcf5dd9465331d9be8734d06afc43d4/inst/workflow/crabs/2-em.Rnd.r#L37
I have done nothing extra.
Works fine for me, can not reproduce the eror.