Skip to content
Prev 54287 / 63424 Next

Cannot Compute Box's M (Three Days Trying...)

Hey Duncan,

Hard to debug? That's an understatement. Eyes bleeding....

In any case, I tried all your suggestions. To get "integer" for the final column, I had to change the code to get integers instead of strings.

double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles();
double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles();
double[] d3 = ((REXPVector) ((RList) tableRead).get(2)).asDoubles();
double[] d4 = ((REXPVector) ((RList) tableRead).get(3)).asDoubles();
int[] d5 = ((REXPVector) ((RList) tableRead).get(4)).asIntegers();

// create data frame with data.REXP myDf = REXP.createDataFrame(new RList(
new REXP[]
{
new REXPDouble(d1),
new REXPDouble(d2),
new REXPDouble(d3),
new REXPDouble(d4),
new REXPInteger(d5)
}));

Here are the results from the eval debug code.

head(boxMVariable)  ? Gives the high level 5 objects.

typeof(boxMVariable): ?list?

class(boxMVariable) : ?data.frame?

names(boxMVariable)  ? String object returned (couldn't evaluate it)

ncol(boxMVariable)  - 5

nrow(boxMVariable)   - 150

typeof(boxMVariable)

for (i in 1:5) print(typeof(boxMVariable[[i]]))
I get:
1 ?> double
2 ?> double
3  ?> double
4 ?> double
5 ->  integer

Is this problem "debug-proof"?

Does anyone out there actually use Java and R?

Sigh...

Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.
Message-ID: <9BD27QZMzsNhYUSXQNpmzB6M1_eswp75Vyk6vgZ67jKV3Mf8H3ji_fE_YVPRSOl9Pb7XZDy1nfJCHyqt5J8hzVCzg9JxsJ-piLcIeu_7JZ4=@protonmail.com>
In-Reply-To: <ee03e49f-9c97-5e34-d12e-7623effcf062@gmail.com>