ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* modernized and augmented m-r.tex
@ 2008-12-08 11:59 Johan Sandblom
  2008-12-08 19:16 ` Mojca Miklavec
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Sandblom @ 2008-12-08 11:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

The ConTeXt module for interaction with the statistical programming
language R currently does not work with MKIV since buffers are not
saved to file. The included file fixes this by calling \savebuffer on
the buffer in case \ctxlua is defined (a trick gleaned from a
discussion on the LilyPond module a while back).

Also, all calls to R used to include a rather annoying proc.time()
statement at the end, and a modified R call has fixed this. PATH must
contain R or R.exe on Windoze. Should 'texmfstart' still be used for
the R calls?

A third modification involves being able to call \startRnoecho (which
only echoes R output in the ConTeXt file) in addition to \startR
(which echoes both input and output) and \startRhidden (which echoes
nothing, useful for generating graphics)

One further improvement would be to collect the R snippets and run
them all at once. That would significantly reduce processing time
since the R startup is on the order of a few seconds. However, that is
beyond my knowledge of ConTeXt.

Regards, Johan

-- 
Johan Sandblom, MD PhD
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell

[-- Attachment #2: m-r.tex --]
[-- Type: application/x-tex, Size: 4263 bytes --]

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: modernized and augmented m-r.tex
  2008-12-08 11:59 modernized and augmented m-r.tex Johan Sandblom
@ 2008-12-08 19:16 ` Mojca Miklavec
  2008-12-08 21:32   ` Johan Sandblom
  0 siblings, 1 reply; 3+ messages in thread
From: Mojca Miklavec @ 2008-12-08 19:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Dec 8, 2008 at 12:59 PM, Johan Sandblom wrote:
>
> One further improvement would be to collect the R snippets and run
> them all at once. That would significantly reduce processing time
> since the R startup is on the order of a few seconds. However, that is
> beyond my knowledge of ConTeXt.

More philosophical question than a question of implementation.

If you want to generate some images with R than you can do that in one
run anyway (you need to include those images with several
\externalfigure commands anyway). If you want several ls() statements
that print out something: how are you going to know which output
belongs to which script?

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: modernized and augmented m-r.tex
  2008-12-08 19:16 ` Mojca Miklavec
@ 2008-12-08 21:32   ` Johan Sandblom
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Sandblom @ 2008-12-08 21:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2008/12/8 Mojca Miklavec <mojca.miklavec.lists@gmail.com>:
> On Mon, Dec 8, 2008 at 12:59 PM, Johan Sandblom wrote:
>>
>> One further improvement would be to collect the R snippets and run
>> them all at once. That would significantly reduce processing time
>> since the R startup is on the order of a few seconds. However, that is
>> beyond my knowledge of ConTeXt.
>
> More philosophical question than a question of implementation.
>
> If you want to generate some images with R than you can do that in one
> run anyway (you need to include those images with several
> \externalfigure commands anyway). If you want several ls() statements
> that print out something: how are you going to know which output
> belongs to which script?

Yes it is interesting doing it this way, the latex people do it the
other way around: they run a mixed R/LaTeX file through an R function
that puts evaluated R code instead, run this file through LaTex and
voila. But if there is no requirement for elegance I am sure there are
ways to do it this way as well, some trickery with comments perhaps or
searching for the next input. Rather a lot of work to get either of
them going though ...

Johan

> Mojca
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>



-- 
Johan Sandblom, MD PhD
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-08 21:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-08 11:59 modernized and augmented m-r.tex Johan Sandblom
2008-12-08 19:16 ` Mojca Miklavec
2008-12-08 21:32   ` Johan Sandblom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).