From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: org-babel-R and windows ? Date: Tue, 12 Jan 2010 12:43:53 -0500 Message-ID: <878wc3kyli.fsf@stats.ox.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUkmi-0004Wa-3g for emacs-orgmode@gnu.org; Tue, 12 Jan 2010 12:44:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUkmd-0004U7-BG for emacs-orgmode@gnu.org; Tue, 12 Jan 2010 12:44:03 -0500 Received: from [199.232.76.173] (port=59233 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUkmd-0004U3-01 for emacs-orgmode@gnu.org; Tue, 12 Jan 2010 12:43:59 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:54598) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NUkmc-00040g-H5 for emacs-orgmode@gnu.org; Tue, 12 Jan 2010 12:43:58 -0500 In-Reply-To: (d. tchin's message of "Tue, 12 Jan 2010 13:24:14 +0000 (UTC)") 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: "d.tchin" Cc: emacs-orgmode@gnu.org "d.tchin" writes: > I need help to be able to use org-babel functionality.=20 > 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)=20=20 > (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.=20 > > 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=C3=A9pertoire 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-ses= sion 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=3D"c:/Temp/emacs/tmp/R-out-functional-results445= 2y8r",=20 > sep=3D"\t", na=3D"nil",row.names=3DFALSE, col.names=3DFALSE, quote=3DFALS= E) > > > 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. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode