testlist <- list(p = structure(c(2.33690402846372e-161, 415222.348752633, 4.11629290795122e+301, 1.78100510512629e+34, 1.73921479125752e+22, 2.54358200674319e+240, 1.08251186625261e+25, 5.82189403683666e+257, 6.15118716253206e+72), .Dim = c(1L, 9L)), pi_inv = structure(c(8.18638114462567e+114, 4.30464346372159e+175, 3.10788509012706e-81, 8.44057464735496e-165, 2.93713071250079e-111), .Dim = c(1L, 5L)), ref_order = structure(c(1.36816459861909e+208, 8.25302231076208e-23), .Dim = 2:1), weights = c(4.55436050875997e-291, NA, 3.5173008964612e+277, -2.79723594878421e-160, -1.22280264558513e+300, 4.50544546167993e-300, 4.84575336878798e+256, -7.3370462516169e-113, NaN, 7.53020428630546e-74, -582347629766237312, -Inf, -2.90600582109847e-262, -2.13563397528983e-141, 7.81869978696906e+200, -2.90977749835357e-267, 5.20899265468637e+56, 2.74722033381655e-204, -1.10990447695013e-36, 3.07951867328442e+185, 1.12233384679385e+217, NA, -2.35332099244933e+290, 2.88653324541623e-153, 8.7133369273623e+159, 3.77302047232097e+109, 1.44429128517536e-292, 8.01537952490516e-305, Inf, -8.33084527010223e-157, 0)) result <- do.call(PLMIX::loglikPLMIX,testlist) str(result)