I have an odd error in R.
I have a big function that does a lot of stuff. Inside, I have, essentially, the MWE
check_mul = function(){
S = matrix(runif(100 * 5), 100, 5)
Q = rep(1, 100)
t = S / Q
return(t)
}
This works fine. In my function, it errors, telling me the arrays are non-conformable.
However when I add a browser()
command right before the multiplication command, or in a tryCatch
block, entering the scope of the function, the multiplication works!
I'm very confused, by all means it should work, and it does, when debugging.
Is there some obvious gotcha I'm missing? What are some next steps I can do to debug?