[R] CEoptim problems

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Tue Apr 9 12:22:04 CEST 2024


В Tue, 9 Apr 2024 12:04:26 +0200
Adelchi Azzalini <azzalini using stat.unipd.it> пишет:

> res <- CEoptim(sumsqrs, f.arg = list(xt), continuous = list(mean =
> c(0, 0, 0), sd = rep(1,    3), conMat = A, conVec = b), discrete =
> list(categories = c(298L, 298L), smoothProb = 0.5),    N = 10000, rho
> = 0.001)
> 
> Error in is.null(A) || is.na(A) : 
>   'length = 18' in coercion to 'logical(1)'

There is a book titled "The R Inferno" with lots of debugging tips for
R: https://www.burns-stat.com/documents/books/the-r-inferno/

Start with a traceback(). Which function gave a matrix to the ||
operator (which accepts only logical scalars)?

If traceback is not enough, use options(error = recover). Once the
error happens, you will be able to inspect local variables inside any
of the active call frames, which may help understand where did A come
from and why it was given to the || operator.

Good luck!

-- 
Best regards,
Ivan



More information about the R-help mailing list