How to do a "Box's M" Test with

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to do a "Box's M" Test with

R devel mailing list
Trying to get past a frustrating error to do a "simple" Box's M test using Java.

The Box's M test says it will work with a data.frame.

Here's the setup code:

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

Here's the call:

REXP boxMResult = rConnection.eval( "boxM(" + myDf+ "[,-5], " + myDf + " [, 5])");

But, I keep getting syntax errors.

If this code isn't right, how do you build a data.frame R will like?  No examples I can find, anywhere.

Not sure what to try next. I've tried just sending a string with everything commented, but nothing I've tried works.

Can anyone please suggest something to try?

Thanks in advance.

- M

Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to do a "Box's M" Test with

Duncan Murdoch-2
On 27/10/2017 8:10 AM, Morkus via R-devel wrote:

> Trying to get past a frustrating error to do a "simple" Box's M test using Java.
>
> The Box's M test says it will work with a data.frame.
>
> Here's the setup code:
>
> REXP myDf = REXP.createDataFrame(new RList(
> new REXP[]
> {
> new REXPDouble(d1),
> new REXPDouble(d2),
> new REXPDouble(d3),
> new REXPDouble(d4),
> new REXPInteger(d5)
> }));
>
> Here's the call:
>
> REXP boxMResult = rConnection.eval( "boxM(" + myDf+ "[,-5], " + myDf + " [, 5])");

I don't really know the R Java interface, but this doesn't make sense.
You are pasting an REXP object myDf into a string to evaluate.  It would
make sense to assign that dataframe object to an R variable, and paste
the name of that variable into your expression, or to construct a
language object containing the dataframe object, but I don't know how to
do those things.

Duncan Murdoch

>
> But, I keep getting syntax errors.
>
> If this code isn't right, how do you build a data.frame R will like?  No examples I can find, anywhere.
>
> Not sure what to try next. I've tried just sending a string with everything commented, but nothing I've tried works.
>
> Can anyone please suggest something to try?
>
> Thanks in advance.
>
> - M
>
> Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to do a "Box's M" Test with

R devel mailing list
Thanks for the ideas. I'll keep trying...

Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.

> -------- Original Message --------
> Subject: Re: [Rd] How to do a "Box's M" Test with
> Local Time: October 27, 2017 8:50 AM
> UTC Time: October 27, 2017 12:50 PM
> From: [hidden email]
> To: Morkus <[hidden email]>, [hidden email] <[hidden email]>
>
> On 27/10/2017 8:10 AM, Morkus via R-devel wrote:
>
>> Trying to get past a frustrating error to do a "simple" Box's M test using Java.
>> The Box's M test says it will work with a data.frame.
>> Here's the setup code:
>> REXP myDf = REXP.createDataFrame(new RList(
>> new REXP[]
>> {
>> new REXPDouble(d1),
>> new REXPDouble(d2),
>> new REXPDouble(d3),
>> new REXPDouble(d4),
>> new REXPInteger(d5)
>> }));
>> Here's the call:
>> REXP boxMResult = rConnection.eval( "boxM(" + myDf+ "[,-5], " + myDf + " [, 5])");
>>
>> I don't really know the R Java interface, but this doesn't make sense.
>> You are pasting an REXP object myDf into a string to evaluate. It would
>> make sense to assign that dataframe object to an R variable, and paste
>> the name of that variable into your expression, or to construct a
>> language object containing the dataframe object, but I don't know how to
>> do those things.
>>
>> Duncan Murdoch
>> But, I keep getting syntax errors.
>> If this code isn't right, how do you build a data.frame R will like? No examples I can find, anywhere.
>> Not sure what to try next. I've tried just sending a string with everything commented, but nothing I've tried works.
>> Can anyone please suggest something to try?
>> Thanks in advance.
>>
>> - M
>>
>> Sent from [ProtonMail](https://protonmail.com), Swiss-based encrypted email.
>> [[alternative HTML version deleted]]
>> ---------------------------------------------------------------
>>
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel