From romain.francois at dbmail.com  Thu Dec  3 13:50:33 2009
From: romain.francois at dbmail.com (Romain Francois)
Date: Thu, 03 Dec 2009 13:50:33 +0100
Subject: [Rd] Bug in R evaluating a huge instruction (PR#14096)
In-Reply-To: <4B167913.4030407@codelutin.com>
References: <20091130155010.4EFF1282EFE3@mail.pubhealth.ku.dk>	<4B144659.6090702@stats.uwo.ca>
	<4B14AEB1.9090206@codelutin.com>	<4B152F22.9000506@stats.uwo.ca>
	<4B1616D2.70908@codelutin.com>	<53F62762-1611-4445-97E1-A3B3BA2AB0D4@r-project.org>
	<4B167913.4030407@codelutin.com>
Message-ID: <4B17B419.9050300@dbmail.com>

Hi,

You really should use the REngine API, which lets you control jri and 
Rserve using the same api. See the org.rosuda.REngine package in 
http://www.rforge.net/org/docs/

Either wayn, I have no problem evaluating the problematic string with 
both apis.

Romain

On 12/02/2009 03:26 PM, Jean Couteau wrote:
>> FWIW the restriction is only on the console input - if you send it
>> directly, there is no limit (I have never heard of nuiton-j2r but if
>> you use rJava to interface from Java to R there is no limit - the
>> string you parse+evaluate can be of any length).
> Hi Simon,
>
> nuiton-j2r is in fact an abstraction layer to rjava or rserve so that it
> can switch between one or other implementation using simple
> configuration (http://maven-site.nuiton.org/nuiton-j2r/ sorry but this
> is in french). And in fact I encounter the problem using it.
>
> What is done is basically creating the R instruction from java and
> sending it to R using the eval method from the Rengine object (as we use
> jri in this specific application). The R instruction should create an
> object a of class morris, and I try then to get back the a$X object (the
> X item of the morris object) but I get back a null object without any
> reason, that is why I tried copying the instruction directly in R and
> thus getting this problem.
>
> So that is strange if you say that there is no limit using rjava/jri.
>
> Cheers,
> Jean
>>
>> Cheers,
>> Simon
>>
>>
>>> Duncan Murdoch wrote:
>>>> On 01/12/2009 12:50 AM, Jean Couteau wrote:
>>>>> Thanks for your time Duncan,
>>>>>
>>>>> I join here the instruction that is not correct, hoping that might
>>>>> help you. The file is encoded in utf-8 so you should not have any
>>>>> problem reading it.
>>>>>
>>>>> I doubt to that it is an R bug too, but with all my tests i am less
>>>>> and less sure of that.
>>>>
>>>> I have no problem sourcing that file, but I do get an error if I try
>>>> to cut and paste it, because it's a single line of 4890 characters,
>>>> and that's too long. So this is an R limitation, but it's one with
>>>> an easy workaround: just add some line breaks into your source.
>>>>
>>>> Duncan Murdoch
>>>>
>>>>
>>>>>
>>>>> Best regards,
>>>>> Jean Couteau
>>>>>> Your message has encoding problems, so it's not readable. Could
>>>>>> you put the code online somewhere where we could download it in
>>>>>> its original form? I doubt if this is an R bug, but I can't point
>>>>>> out the problem in your code (or confirm that it really is an R
>>>>>> bug) without an undamaged copy of the code.
>>>>>>
>>>>>> Duncan Murdoch

-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/Gq7i : ohloh
|- http://tr.im/FtUu : new package : highlight
`- http://tr.im/EAD5 : LondonR slides

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MorrisREngine.java
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20091203/b0119e79/attachment.pl>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Morris.java
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20091203/b0119e79/attachment-0001.pl>


[Rd] Bug in R evaluating a huge instruction (PR#14096)
Romain Francois