Skip to content
This repository was archived by the owner on Nov 21, 2020. It is now read-only.

Test run returns > options(error=expression(NULL)) on Ubuntu #15

Open
ukebako opened this issue Jun 14, 2015 · 6 comments
Open

Test run returns > options(error=expression(NULL)) on Ubuntu #15

ukebako opened this issue Jun 14, 2015 · 6 comments

Comments

@ukebako
Copy link

ukebako commented Jun 14, 2015

Hi.
I run the following code:

$r = new RCore(new CommandLineREngine('R'));
echo $r->run("5+3");

On my Mac it works as expected, but when I run it on Ubuntu server it returns just

> options(error=expression(NULL))

UPDATE
I've found out that there's something wrong with end of line.
If i run something like this:

echo $r->run("5+3\n");

then it returns both 'options(...' and the result of the operation in the returning string

@kachkaev
Copy link
Owner

Hi @ukebako,

I haven't tested the code in ubuntu, so there might be problems as you describe. Feel free to contributed to the repository by submitting a pull request if you find a robust and cross-platform solution to what you've discovered.

@cchenship
Copy link

Same problem here. @ukebako did you eventually solve the issue?

@ukebako
Copy link
Author

ukebako commented Aug 1, 2015

Actually adding \n at the end of expression was enough for me. I just grab what I need from the output.

@cchenship
Copy link

Thanks, @ukebako , the "\n" trick did work for me except the leading "options(error=expression(NULL))".
I was wondering whether you were able to remove that leading string.
But, anyhow, you trick helped a lot.

@tallsam
Copy link

tallsam commented Nov 25, 2015

I commented out line 45 in CommandLineRProcess.php but I doubt that is the correct solution

fwrite($this->pipes[0], "options(error=expression(NULL))\n");

tallsam pushed a commit to tallsam/php-r that referenced this issue Nov 25, 2015
@irenge
Copy link

irenge commented Jul 5, 2016

ohkay . how to make it work on fedora 24 too?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants