From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hajage Subject: Re: problem with babel and R Date: Tue, 17 Aug 2010 14:01:03 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0092907469==" Return-path: Received: from [140.186.70.92] (port=49911 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OlKr7-0002gT-V4 for emacs-orgmode@gnu.org; Tue, 17 Aug 2010 08:01:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OlKr6-0006xR-EC for emacs-orgmode@gnu.org; Tue, 17 Aug 2010 08:01:25 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:36331) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OlKr6-0006xE-5j for emacs-orgmode@gnu.org; Tue, 17 Aug 2010 08:01:24 -0400 Received: by fxm3 with SMTP id 3so3797137fxm.0 for ; Tue, 17 Aug 2010 05:01:23 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0092907469== Content-Type: multipart/alternative; boundary=001485f2c18c36537c048e03b587 --001485f2c18c36537c048e03b587 Content-Type: text/plain; charset=ISO-8859-1 I tried the code with the last development version of org-mode: #+srcname: foo #+begin_src R :session *R* :results output org replace library(ascii) options(asciiType = "org") ascii(head(esoph)) #+end_src #+results: foo | | agegp | alcgp | tobgp | ncases | ncontrols | |---+-------+-----------+----------+--------+-----------| | 1 | 25-34 | 0-39g/day | 0-9g/day | 0.00 | 40.00 | | 2 | 25-34 | 0-39g/day | 10-19 | 0.00 | 10.00 | | 3 | 25-34 | 0-39g/day | 20-29 | 0.00 | 6.00 | | 4 | 25-34 | 0-39g/day | 30+ | 0.00 | 5.00 | | 5 | 25-34 | 40-79 | 0-9g/day | 0.00 | 27.00 | | 6 | 25-34 | 40-79 | 10-19 | 0.00 | 7.00 | | | agegp | alcgp | tobgp | ncases | ncontrols | |---+-------+-----------+----------+--------+-----------| | 1 | 25-34 | 0-39g/day | 0-9g/day | 0.00 | 40.00 | | 2 | 25-34 | 0-39g/day | 10-19 | 0.00 | 10.00 | | 3 | 25-34 | 0-39g/day | 20-29 | 0.00 | 6.00 | | 4 | 25-34 | 0-39g/day | 30+ | 0.00 | 5.00 | | 5 | 25-34 | 40-79 | 0-9g/day | 0.00 | 27.00 | | 6 | 25-34 | 40-79 | 10-19 | 0.00 | 7.00 | There is no more ">", but an extra space. But, the replace option doesn't work: results are still appended. I am not an org-mode guru (far, far away), but I think this is because when output is org, there is no indication about the "end" of the results. David On Tue, Aug 17, 2010 at 10:17, David Hajage wrote: > Hello, > > I am trying to use babel with R. Here the code: > > #+srcname: foo > #+begin_src R :session *R* :results output org replace > library(ascii) > options(asciiType = "org") > ascii(head(esoph)) > #+end_src > > #+results: foo > > > | | agegp | alcgp | tobgp | ncases | ncontrols | > |---+-------+-----------+----------+--------+-----------| > | 1 | 25-34 | 0-39g/day | 0-9g/day | 0.00 | 40.00 | > | 2 | 25-34 | 0-39g/day | 10-19 | 0.00 | 10.00 | > | 3 | 25-34 | 0-39g/day | 20-29 | 0.00 | 6.00 | > | 4 | 25-34 | 0-39g/day | 30+ | 0.00 | 5.00 | > | 5 | 25-34 | 40-79 | 0-9g/day | 0.00 | 27.00 | > | 6 | 25-34 | 40-79 | 10-19 | 0.00 | 7.00 | > > > | | agegp | alcgp | tobgp | ncases | ncontrols | > |---+-------+-----------+----------+--------+-----------| > | 1 | 25-34 | 0-39g/day | 0-9g/day | 0.00 | 40.00 | > | 2 | 25-34 | 0-39g/day | 10-19 | 0.00 | 10.00 | > | 3 | 25-34 | 0-39g/day | 20-29 | 0.00 | 6.00 | > | 4 | 25-34 | 0-39g/day | 30+ | 0.00 | 5.00 | > | 5 | 25-34 | 40-79 | 0-9g/day | 0.00 | 27.00 | > | 6 | 25-34 | 40-79 | 10-19 | 0.00 | 7.00 | > > With org-mode 7.01g in emacs 23, there is two problems: > - an extra ">" is added in the first line while output is "org" > - when I run the code twice, the new results is appended, while I have the > option "replace". > > Is there any problem with my header? > > Thank you very much for your help. > David > --001485f2c18c36537c048e03b587 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried the code with the last development version of org-mode:=A0

=
#+srcname: foo
#+begin_src R :session *R* :result= s output org replace
=A0=A0library(ascii)
=A0=A0options= (asciiType =3D "org")
=A0=A0ascii(head(esoph))
#+end_src

= #+results: foo

=A0| =A0 | agegp | alcgp =A0 =A0 | = tobgp =A0 =A0| ncases | ncontrols |
|---+-------+-----------+----= ------+--------+-----------|
| 1 | 25-34 | 0-39g/day | 0-9g/day | 0.00 =A0 | 40.00 =A0 =A0 |
<= div>| 2 | 25-34 | 0-39g/day | 10-19 =A0 =A0| 0.00 =A0 | 10.00 =A0 =A0 |
| 3 | 25-34 | 0-39g/day | 20-29 =A0 =A0| 0.00 =A0 | 6.00 =A0 =A0 =A0= |
| 4 | 25-34 | 0-39g/day | 30+ =A0 =A0 =A0| 0.00 =A0 | 5.00 =A0 = =A0 =A0|
| 5 | 25-34 | 40-79 =A0 =A0 | 0-9g/day | 0.00 =A0 | 27.00 =A0 =A0 |
| 6 | 25-34 | 40-79 =A0 =A0 | 10-19 =A0 =A0| 0.00 =A0 | 7.00 =A0 = =A0 =A0|

=A0| =A0 | agegp | alcgp =A0 =A0 | tobgp = =A0 =A0| ncases | ncontrols |
|---+-------+-----------+----------+--------+-----------|
| 1 | 2= 5-34 | 0-39g/day | 0-9g/day | 0.00 =A0 | 40.00 =A0 =A0 |
| 2 | 25= -34 | 0-39g/day | 10-19 =A0 =A0| 0.00 =A0 | 10.00 =A0 =A0 |
| 3 |= 25-34 | 0-39g/day | 20-29 =A0 =A0| 0.00 =A0 | 6.00 =A0 =A0 =A0|
| 4 | 25-34 | 0-39g/day | 30+ =A0 =A0 =A0| 0.00 =A0 | 5.00 =A0 =A0 =A0= |
| 5 | 25-34 | 40-79 =A0 =A0 | 0-9g/day | 0.00 =A0 | 27.00 =A0 = =A0 |
| 6 | 25-34 | 40-79 =A0 =A0 | 10-19 =A0 =A0| 0.00 =A0 | 7.0= 0 =A0 =A0 =A0|

There is no more ">", but an extra space.
But, the r= eplace option doesn't work: results are still appended. I am not an org= -mode guru (far, far away), but I think this is because when output is org,= there is no indication about the "end" of the results.=A0

David


On Tue, Aug 17, 2010 at 10:17, David Haj= age <dhajage@gmai= l.com> wrote:
Hello,=A0

I am trying to use babel with R. Here the code= :

#+srcname: foo
#+begin_src R :session *R* :results output org replace
=A0=A0library(ascii)
=A0=A0optio= ns(asciiType =3D "org")
=A0=A0ascii(head(esoph= ))
#+end_s= rc

#+results= : foo

=
> | = =A0 | agegp | alcgp =A0 =A0 | tobgp =A0 =A0| ncases | ncontrols |
|---+-------+---------= --+----------+--------+-----------|
| 1 | 25-34 | 0-39g/day | 0-9g/day | 0.00 =A0 | 4= 0.00 =A0 =A0 |
| 2 | 25-34 | 0-39g/da= y | 10-19 =A0 =A0| 0.00 =A0 | 10.00 =A0 =A0 |
| 3 | 25-34 | 0-39g/day | 20-29 =A0 = =A0| 0.00 =A0 | 6.00 =A0 =A0 =A0|
| 4 | 25-34 | 0-39g/da= y | 30+ =A0 =A0 =A0| 0.00 =A0 | 5.00 =A0 =A0 =A0|
| 5 | 25-34 | 40-79 =A0 =A0 | 0-9g/= day | 0.00 =A0 | 27.00 =A0 =A0 |
| 6 | 25-34 | 40-79 = =A0 =A0 | 10-19 =A0 =A0| 0.00 =A0 | 7.00 =A0 =A0 =A0|

> | = =A0 | agegp | alcgp =A0 =A0 | tobgp =A0 =A0| ncases | ncontrols |
|---+-------+------= -----+----------+--------+-----------|
| 1 | 25-34 | 0-39g/da= y | 0-9g/day | 0.00 =A0 | 40.00 =A0 =A0 |
| 2 | 25-34 | 0-39g/day | 10-19 =A0 =A0| 0.= 00 =A0 | 10.00 =A0 =A0 |
| 3 | 25-34 | 0-39g/da= y | 20-29 =A0 =A0| 0.00 =A0 | 6.00 =A0 =A0 =A0|
| 4 | 25-34 | 0-39g/day | 30+ =A0 =A0= =A0| 0.00 =A0 | 5.00 =A0 =A0 =A0|
| 5 | 25-34 | 40-79 = =A0 =A0 | 0-9g/day | 0.00 =A0 | 27.00 =A0 =A0 |
| 6 | 25-34 | 40-79 =A0 =A0 | 10-19 = =A0 =A0| 0.00 =A0 | 7.00 =A0 =A0 =A0|

With org-mode=A07.01g in emacs 23, there is two problems:
=A0- an extr= a ">" is added in the first line while output is "org&quo= t;
=A0- when I ru= n the code twice, the new results is appended, while I have the option &quo= t;replace".

Is there any problem with my header?
<= font face=3D"Times, serif" size=3D"4">
Thank you very much for your help.
<= div>David

--001485f2c18c36537c048e03b587-- --===============0092907469== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0092907469==--