[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] org-babel-R and windows ?
From: |
Dan Davison |
Subject: |
Re: [Orgmode] org-babel-R and windows ? |
Date: |
Tue, 12 Jan 2010 12:43:53 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
"d.tchin" <address@hidden> writes:
> I need help to be able to use org-babel functionality.
> I use emacs 22.3.1 in windows XP and org-mode 6.34.
>
> I have the following instructions in .emacs
>
> (require 'org-install)
> (require 'org-plot)
> (require 'org-babel-init)
> (require 'org-babel-R) ;; requires R and ess-mode
> (require 'org-babel-python) ;; requires python, and python-mode
> (require 'org-babel-ditaa)
>
> ESS module is loaded before :
>
> (load "~/emacs/emacs-22.3/site-lisp/ess-5.7.1/lisp/ess-site")
>
>
> I don't manage to get any output with R Software.
>
> Below you will find test I have done :
>
> #+srcname:trial
> #+begin_src sh
> echo output
> #+end_src
>
> #+results: trial
> : output
>
> #+srcname:trial
> #+begin_src R
> c(4,5,6,7,8,9)
> #+end_src
>
>
> I manage to have shell output, but when I tried R procedure,
> I have the following output in *Messages* buffer
>
> executing R source code block...
> Syntaxe du nom de fichier, de répertoire ou de volume incorrecte.
> Source block produced no output
The org-babel default is to invoke R as an external shell command, and I
think this is what is causing the problem. It requires that the emacs
function shell-command can use the string "R" to invoke an R process,
i.e. the R installation and the shell path must be such that this is the
case.
Seeing as you have ESS installed, how about using session-based
evaluation? This means that org-babel uses an interactive R session
running under the control of ESS. In general it is a better way to work
with R in org-babel. It is described in the section "Session-based
Evaluation" in
http://orgmode.org/worg/org-contrib/babel/intro.php
and also in the reference manual:
http://orgmode.org/worg/org-contrib/babel/reference.php#header-argument-session
basically you just set the :session header argument, e.g.
#+srcname:trial
#+begin_src R :session org-babel-R-session
c(4,5,6,7,8,9)
#+end_src
Have a look here to see the different methods you can use to make this
the default (without having to explicitly set the header arg each time)
http://orgmode.org/worg/org-contrib/babel/reference.php#sec-3.1
Dan
>
> I have a look on temporary directory and I have the folllowing
> file :
>
> R-in-functional-results4452lyl
>
> Inside the following source code :
>
> main <- function ()
> {
>
> c(4,5,6,7,8,9)
>
>
> }
> write.table(main(), file="c:/Temp/emacs/tmp/R-out-functional-results4452y8r",
> sep="\t", na="nil",row.names=FALSE, col.names=FALSE, quote=FALSE)
>
>
> The file R-out-functional-results4452y8r exists but is empty.
> What I miss to make it work ?
>
> Regards
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
- [Orgmode] org-babel-R and windows ?, d . tchin, 2010/01/12
- Re: [Orgmode] [babel] org-babel-R and windows ?, Giovanni Ridolfi, 2010/01/12
- Re: [Orgmode] org-babel-R and windows ?,
Dan Davison <=
- Re: [Orgmode] org-babel-R and windows ?, Eric Schulte, 2010/01/12
- Re: [Orgmode] org-babel-R and windows ?, Manish, 2010/01/12
- [Orgmode] Re: org-babel-R and windows ?, d . tchin, 2010/01/13
- Re: [Orgmode] Re: org-babel-R and windows ?, Dan Davison, 2010/01/13
- [Orgmode] Re: org-babel-R and windows ?, Sébastien Vauban, 2010/01/14
- Re: [Orgmode] [babel] Re: org-babel-R and windows ?, Dan Davison, 2010/01/14
- [Orgmode] Re: [babel] Re: org-babel-R and windows ?, Sébastien Vauban, 2010/01/14
- Re: [Orgmode] Re: [babel] Re: org-babel-R and windows ?, Stefan Vollmar, 2010/01/15