Insert->session ->R does not start R session in Texmacs 2.1.1 in Windows

Dear sir,

I am new to Texmacs, but not new to R, Rstuduo, Asciidocdor, latex etc.

I am basically a statistician. I was in search of a wysiwyg scientistific documentation platform which can produce book publication quality pdf and other formats. I have written one book in Rstuduo on Statistics design using R scripts. I am writing another book on Statistical methods using R on Lyx platform which is basically LaTeX based. Lyx is better than Rmarkdown, yet it doesn’t satisfy my requirements fully, e.g. R scripts have to be run separately.

Meanwhile, I came across Texcmacs 2.1.1 for Windows, which is my OS. I am experimenting with it. But, unfortunately R session is not running. It shows ‘Busy’ message in red colour above R prompt, but does NOT evaluate even a basic R expression. I also entered manual path of R’ binary file ‘Rterm’. Even then same symptoms are coming.

Please help me. How yrun R scripts.

Dr. A. K. Singh

Hi @akhileshsingh.igkv and welcome to the forum.

I think it is necessary some debugging and some patience to get to the root of the malfunctioning;
right now I am on my Linux, so I cannot check the Windows plugin, said this as a first step you might try to launch a Scheme session and evaluate the command

 (supports-r?)

and report here the output.
Please write if you do not know how to do it.

G.

In addition to my first answer, this forum post might be relevant.

Thanks for you quick response.
I launched Scheme session just like I had tried to launch R session. This time I didn’t get any ‘Busy’ signal in red, rather a green prompt in a yellow band like text box as follows, wherein I typed ‘(supports-r?)’ and pressed enter key:
Scheme] (supports-r?)
#t
That is, I got the output as ‘#t’.
As for your second suggestion, I could not understand that, as I have been a Windows user throughout.

I hope the solution would be obtained soon.
Thanks again.

Dr. A.K. Singh

@akhileshsingh.igkv Could you please try (url-resolve-in-path "tm_r") in the Scheme session?

Please also provide the contents of the folder C:\Program Files (x86)\TeXmacs\plugins\r\bin\ (or if you have installed TeXmacs elsewhere, the subdirectory plugins\r\bin of that folder).

Thanks for your quick response.

For Scheme session command,
(url-resolve-in-path “tm_r”)
I got following output,
<url {}>

Moreover, my Taxmacs is installed in this very subdirectory as mentioned by you above, i.e, in C:\Program Files (x86)\TeXmacs\plugins\r\bin\ , wherein one file resides. Its name is “r_install”, which contains some texcsmacs scripts probability, as I knew on opening it in notepad text editor, but did not change or save, simply closed it as such.

With regards,

Dr. A. K. Singh

AFAICT it won’t work without the tm_r executable, which it seems is missing from your installation (as is also mentioned in the other thread @pireddag linked to).

You could try this build of TeXmacs, perhaps it does include the necessary file (I haven’t tried):

Nope, on my side the r plugin has never compiled in Mingw, AFAIR. I think the interprocess communication is relying on some posix stuff that needs to be transformed to a windows equivalent.

Thanks for sending the new link for Texmacs.
From there I downloaded the Texmacs 2.1.2 + file with the name “texmacs_installer.2.1.2.14105M.exe”.
Uninstalled the old one, and installed this one, and carried out the two tests as suggested above on two occasions. The outputs are given below:
Scheme] (supports-r?)

#t

Scheme] (url-resolve-in-path “tm_r”)

Unbound variable: “tm_r”

Scheme]

It may be noted that this time the second output is different. But, still R-session is still giving ‘Busy’ output as follows:

Busy…

R] c(1:100)

Busy…

R]

Moreover, it is should be informed that this time too, the texmacs installed in the above mentioned path only.

In the last, I have a lingering doubt. Since the version 4.2.0, R has stopped releasing 32 Bit application and now only releases 64bit application. At present, I am running R-4.3.0, the current version. And I guess that Texmacs is 32 bit application. So, could it be the reason of R not connecting with Texmacs? Just a guess. However, this time another change of ‘Unbound variable: “tm_r”’ is also comming.

I do not know what is happening. Is there Texmacs 64 bit? Kindly help and bring me to the solution, please.

With regards,

Dr. A.K. Singh

Time to rewrite that plugin in anther language. Python or Scheme, I guess. R is a very popular language, we should be able to support it better.

4 Likes

Hi @akhileshsingh.igkv, from what I can see, and looking also at the whole previous thread Does the R plugin work?, I think the plugin (unfortunately) does not work in Windows.

I think this both @pjoyez said that he does not remember the R plugin to compile; the failed compilation test that I did myself is less significant because I did it by trial and error.

Hopefully someone will pick this up and provide an R plugin! (It is too difficult for my current ability, so I am not proposing that I shall do it).

The Jupyter plugin with an R kernel could be a workaround. (though I haven’t tested it on Windows either)

Yes, I agree. I tested many editors/languages for writing book or articles. Everyone has one or the other shortcoming which forces me to try the other. I thought that my search ends here because it has all the document writing features. But, here too the problem is that R plugin is not up to date. Since I am an Statistician, I can’t do without R codes. Most statisticiand go to R markdown platform because none of developers have integrated R so nicely as Rstuduo. The Markdown language is easy but NOT good for perfect documentation, like that of Texmacs.

But, due to old R plugin I will have to leave Texmacs TEMPORARILY till R plugin is updated for Windows.

I request the developers to take up this matter in priority, so users of my kind may be benefited.

Had this R plugin been updated, I would have taught Texmacs to my students too for their practical work in statistics and their thesis writing too. My students study R. But, without support of R plugin this would NOT be possible.

I hope and shall WAIT till some developer takes up this matter in priority.

Thanks and regards,

Dr. A. K. Singh

2 Likes

Dear, jeroen,
Will you kindly suggest in detail as how can I use jupyter plugin with an R kernel as a workaround. I will test it, because I work on Windows. And I need it. Please suggest step wise.

With regards,
Dr. A. K. Singh

First a disclaimer: this isn’t tested, so you may be spending time for no outcome. Also, I can’t provide step by step instructions, as I am not a Windows user, so you’ll have to do some research of your own.

First step would be to install Jupyter and the IR-kernel.

1 Like

Thanks for reply.
First I installed IRkernel package in R.
Then I installed Jupyter. But, Jupyter didn’t show R kernel inside Jupyter. So, I googled.
Then, I ran IRkernel:::installspec()
Then, Jupyter started showing R kernel inside it.
But, still then, Taxmacs didn’t run R, only showing Busy status in R.

I hope some developer will have to see to it ,to solve the problem for the sake of users of a popular language R.

With regards,

A.K. Singh

The next step is to install the Jupyter plugin to allow TeXmacs to communicate with Jupyter, which in turn calls R.

You need to download the plugin from here, unzip it, then copy the folder tm-jupyter-master to the plugins subfolder of your TeXmacs home path (execute (get-texmacs-home-path) in Scheme to find out where it is).

Finally rename the copied folder from tm-jupyter-master to jupyter and restart TeXmacs. You should now have Jupyter sessions available, hopefully with R. If not, try Tools->Update->Plugins and restart.

1 Like

Thanks jeroen, for taking pains for me. I felt very hopeful with your post. I tried all the steps steadily and carefully. Did all the steps. But, I don’t know why it didn’t work. Meanwhile, I updated to Texmacs 2.1.2 from GitHub. I tried all the steps on it.

I also tried by copying the renamed jupyter folder to plugin path " `C:\Program Files (x86)\TeXmacs\plugins" , even then after update plugin step and restart, it did not show jupyter session.

After all above stei, I also tried the command (supports-jupyter?), which gave the reply “#f”. And, then tried the command (url-resolve-in-path “tm-jupyter”), which gave reply <url {}>.

With regards,

Dr. A.K.Singh

Sorry to hear it didn’t work. It may be because of the use of shebangs to run scripts, which isn’t supported on Windows.

I have been working recently on a complete rewrite of the Jupyter plugin to use a more high-level library. I’ve made a change so that it calls the python command directly, which should give better Windows compatibility.

You can download it here. The same instructions apply. The unzipped folder needs to be renamed jupyter inside the TeXmacs home plugins folder.

Note that this plugin is still missing important features, such as auto-completion and syntax highlighting.

Also note that this plugin will currently only work in the home directory, not in Program Files.

1 Like

Thanks jeroen, I will try it and will tell you itsfeedback.

Meanwhile, I want to give you another feedback. That, except the Scheme session, none of plugins’ sessions in TeXmacs are running, all are giving Busy status like R plugin. This information may likely to lead you to some important clue.

With regards,

Dr. A. K. Singh