R/R Studio, w/ Xojo UI

To whom it may concern,

My name is Maria and I am a marine biologist.

I am developing a software related to biology (sea turtle sex determination) in R/R Studio, and I wanted to improve its User Interface. In that sense, I would like to ask if Xojo/Real Studio can work together with an R program. Hope you can answer me as soon as possible (and that the answer is positive!), since I have until tomorrow to decide which UI program to use.

Thank you in advance for the attention.

Best regards, Maria Sousa Martins

Depending on your implementation, perhaps a Xojo app could send Shell commands to your R app and wait for responses? I’m afraid I don’t know enough about R or R/Studio to offer other guidance.

(Maria originally asked this on Facebook and I directed her here in the hopes others might have some advice for her. The above was my original reply on Facebook).

Thank you again Paul :slight_smile:

PostgreSQL lets you create stored procedures in R ( they call it PL/R, see http://www.joeconway.com/plr/). Xojo communicates well with PostgreSQL, so it might be worth a try.

Thank you Max for the help! I’ll try :slight_smile:

Hi Maria I don’t know anything about R studio but taking a look at the website it seems to be able to make desktop applications or web applications. Since you didn’t mention which one you’re making I’ll give you some advice for either situation.

For desktop applications:
Typically two or more applications can communicate with each other using an IPC socket. IPC stands for Inter Process Communication. A socket is a code object used for communication. Assuming R studio has an IPC socket then yes you could use IPCsockets to communicate. Although beware I’m not sure if Xojo builds on Windows support IPC sockets.

If R studio doesn’t have IPC sockets (or you want to build for Windows OS) then other sockets may be used such as TCPsockets.

If R studio doesn’t have any sockets then communication can still be possible by using one or more text files which both applications are using to retrieve and send each other messages. This solution is not ideal but it’s very doable. Each application would periodically check (using a timer) if there’s any new messages by reading the text file’s data and if so do whatever it’s supposed to.

Something like this :

Xojo app wants to tell your R app to do something.
Xojo app would write this command to the specified text file which your R app is periodically checking.

Your R app is using a timer to periodically check the text file looking for commands from the Xojo app.
If the command exists, your R app does whatever. Once whatever is finished your R app could remove that command from the text file so it doesn’t endlessly repeat that function.

Same process for your R app ‘talking’ to your Xojo app. The R app would write a command to the text file that the Xojo app is checking.

Alternatively if you’re using a database which supports concurrent connections you should probably use that instead of a text file. Both apps would periodically check the database for commands from the other app.

So something like that would work although not an ideal situation.

If you’re R app is a web application located locally or on the internet :

Then you could use Xojo http or https sockets to communicate with your R app. However be advised Xojo currently does not support http 1.1 at this time so if your R app only supports that you’ll have to come up with another Xojo solution which will be more work. Nobody knows when Xojo is going to support http 1.1 but we hope it’s coming soon.

Are you by chance studying the turtles of Hawaii that are getting cancerous tumors and dying ?
Very sad situation :frowning:
I wonder if it’s from the radiation and or other pollutions?

Hope this helped you and please keep up the good work :slight_smile:

No word from Maria huh?

It is passed your deadline of choosing a UI program.

Maria what was your choice of UI?

Wondering why you haven’t written back?

Did you investigate the options I and others suggested?