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 <dhaj...@gmail.com> 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
>
_______________________________________________
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

Reply via email to