From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/61777 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Removing banner from mtxrun output Date: Mon, 20 Sep 2010 05:17:30 -0400 (EDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1284973946 28397 80.91.229.12 (20 Sep 2010 09:12:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Sep 2010 09:12:26 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 20 11:12:25 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OxcQC-0007Pg-Bz for gctc-ntg-context-518@m.gmane.org; Mon, 20 Sep 2010 11:12:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BB25FCA69A; Mon, 20 Sep 2010 11:12:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id teQX7tDTRpnY; Mon, 20 Sep 2010 11:12:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AB4C2CA647; Mon, 20 Sep 2010 11:12:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C6336CA647 for ; Mon, 20 Sep 2010 11:12:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Yq51YwwCjvbA for ; Mon, 20 Sep 2010 11:12:08 +0200 (CEST) Original-Received: from filter2-nij.mf.surf.net (filter2-nij.mf.surf.net [195.169.124.153]) by balder.ntg.nl (Postfix) with ESMTP id 73289CA5D9 for ; Mon, 20 Sep 2010 11:12:08 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter2-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8K93Vet012156 for ; Mon, 20 Sep 2010 11:03:32 +0200 Original-Received: FROM adi-netbook (bas3-montreal02-1096680921.dsl.bell.ca [65.94.5.217]) By hackers.mr.itd.umich.edu ID 4C972564.85620.17879 ; Authuser adityam; 20 Sep 2010 05:12:04 EDT In-Reply-To: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.81; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0aD8V3vAQ - 3099c7f73316 - 20100920 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:61777 Archived-At: On Mon, 20 Sep 2010, Johan Sandblom wrote: > In the modernized version of the R module (attached), which makes it > possible to interact with the statistical programming environment R > (http://www.r-project.org), mtxrun is used to call R on saved buffers > containing snippets of R code. Optionally, the output from R can be > included using \typefile. However, mtxrun includes a banner in the > output file, example below. Why are you using input output redirection R .... < \Rfile\space > \Rfile.out rather than a simple R .... \Rfile\space \Rfile.out > MTXrun | > MTXrun | executing: R -q --save --restore > MTXrun | > MTXrun |> sample(1:10) > [1] 5 3 1 9 2 6 10 8 4 7 >> sample(1:10, replace=TRUE) > [1] 1 10 7 1 7 5 2 2 10 5 See http://archive.contextgarden.net/message/20100611.141914.fd6567be.en.html but the banner still appears the first time mtxrun --ifchanged is run. @Hans, mtxrun be completely silent when used to launch external programs and only give some output if --verbose is passed. BTW, there is a serious bug in the R module: each code chunck carries a state with it (--save --restore), but this state can depend on which chunck was changed. Consider (I don't know the R syntax on top of my head, but this gives the idea of the bug) Chunk 1 \startR a = 10 ; b = 10 ; \stopR Chunk 2 \startR a = 20 ; b = 20 \stopR Chunck 3 \startR print(a+b) ; \stopR Run this once. The output will be 40. Now, add c = 10 ; in Chunk 1. Also change Chunk 3 to (add spaces so that md5 sum is different) print( a + b ) ; Now run the file again. Since Chunk 2 is not changed, it will not be run. Chunk 3 will see the state set by Chunk 1, and hence the output will be 20. This "bug" can be avoided by doing some book keeping for the external state (saving the file to a different name and restoring it), or by not using --save and --restore. Aditya ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________