mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] R plugin on Mac OS X


Chronological Thread 
  • From: Michael Lachmann <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] R plugin on Mac OS X
  • Date: Thu, 12 Jul 2012 16:50:21 +0800

Hi,

I'm now working on cleaning up the R file.

I have a couple of questions:

1. The function v() in R will insert the current plot into the buffer.
It is supposed to support inserting the image using "ps:", and also
using
"scheme:(image (tuple (raw-data..."
and
"scheme:(image (tuple (# ..."

I think this used to work at some point. Now, when I send hex data, I
get the error:
<error|bad image|<tuple<error|compound
#XXXX... >|
png>>

When I save the file, and reload it, I get a correct figure, though.

The commands that generate the image are:
cat("\002scheme:(image (tuple (#",sep="")
flush(stdout())
system2("hexdump",args=c("-v","-e","'1/1 \"%02X\"'",op$file),stdout=stdout())
flush(stdout())
cat(") \"",format,"\") \"0.8par\" \"\" \"\" \"\")\005\n",sep="")

which are pretty self-explanatory, except that "cat" will print its arguments.

This should produce:
\2scheme:(image (tuple (#
[now the hexdump]
) "png") "0.8par" "" "" "")\5

Do I do something wrong?

2. This is actually a future improvement. But I'd like to be able to
insert a scheme for a function with its arguments. I.e. when the user
asks to insert a certain function into the input field, I'd like to
insert something like
function.name( argument1=[], argument2=[], .. )
so that the user can easily traverse between the arguments with the
left-right keys, i.e. the cursor starts within the [] of argument1,
and if I hit -> then I get into the [] of argument2, and so on. Is
something like this possible?

Thanks,
Michael


On 2 July 2012 04:27, Joris van der Hoeven <address@hidden> wrote:
> Hi Michael,
>
> If you have an update for the R plug-in, then please let me know.
> Under MacOS, I can evaluate 1+1, but I cannot do things which are
> more interesting with the current plug-in.
>
> Best wishes, --Joris
>
>
> On Sun, May 27, 2012 at 12:27:03PM +0200, Michael Lachmann wrote:
>> Hi,
>>
>> I originally wrote the R plugin, so I'm responsible for its awful
>> state. I had little free time in the last years...
>> The problem is this:
>> The R plugin should run when TeXmacs finds R, but should install
>> correctly when TeXmacs is installed whether or not R is installed at
>> that time. On the other hand, R really doesn't like to run a package
>> prepared for a different version of R....
>> One possibility is that the package is compiled in the user's TeXmacs
>> directory when R is first found. Kida ugly. Or, R could install the
>> package into the user's R library, a bit nicer, but I'm not sure all
>> uses will have a writable user specific library directory ready.
>>
>> Another option would be that the user runs something like
>> install.packages("TeXmacs") which will grab the latest TeXmacs library
>> from CRAN, or
>> install.packages("path/to/TeXmacs.tar.gz", repos=NULL)
>>
>> I wanted to create a little web page that explains how to use the
>> plugin. Maybe in a week or two.
>>
>> The latest, still unsubmitted, version of the TeXmacs script can be used
>> with
>> source("http://www.eva.mpg.de/~lachmann/TeXmacs.R";)
>>
>> tab-completion should work with the R plugin.
>> After establishing password-less log in to a remote machine,
>> you can do the following to run R on it, inside TeXmacs. (I use this
>> ALL THE TIME!)
>>
>> system("ssh -t remote.machine /path/to/R")
>>
>> After logging in, do
>> source("http://www.eva.mpg.de/~lachmann/TeXmacs.R";)
>>
>> and if you want to use graphics,
>> start.view()
>>
>>
>> To edit a function/object inside TeXmacs with syntax highlighting, use
>> t.edit:
>> t.edit( myfunction )
>>
>> There are two modes of viewing R help files in TeXmacs. The first, the
>> default, just displays them in-buffer (this is what I use usually).
>> The second opens a new buffer for each help page, from the html. To
>> get the second behavior, do
>> t.start.help()
>>
>>
>> Michael
>
>
>



Archive powered by MHonArc 2.6.19.

Top of page