From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Babel - simple getting started problem Date: Mon, 07 Dec 2009 12:12:15 -0500 Message-ID: <87fx7m674g.fsf@stats.ox.ac.uk> References: <2c75873c0912062320m20284efawb5b4414fa5593691@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHh8L-0004DK-PY for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 12:12:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHh8G-00046t-Jd for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 12:12:25 -0500 Received: from [199.232.76.173] (port=56330 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHh8G-00046d-AZ for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 12:12:20 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:51803) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHh8G-00041t-IE for emacs-orgmode@gnu.org; Mon, 07 Dec 2009 12:12:20 -0500 In-Reply-To: <2c75873c0912062320m20284efawb5b4414fa5593691@mail.gmail.com> (Graham Smith's message of "Mon, 7 Dec 2009 07:20:19 +0000") 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: Graham Smith Cc: emacs-orgmode@gnu.org Graham Smith writes: > I know I must be missing the obvious here, but why can't I get babel+R > to calculate a mean. See below > > Many thanks, > > Graham > > * test > #+srcname:trial > #+begin_src R > x<-c(4,5,6,7,8,9) > #+end_src > > #+resname: trial > | 4 | > | 5 | > | 6 | > | 7 | > | 8 | > | 9 | > > > * meantest > #+begin_src R > mean(trial) > #+end_src Hi Graham, Here's a version of your example that works. Dan * test #+srcname:trial #+begin_src R c(4,5,6,7,8,9) #+end_src Note I deleted the 'x <-' there. Unless you're using :session there's no point assigning to a variable which is not used. #+results: trial | 4 | | 5 | | 6 | | 7 | | 8 | | 9 | * meantest #+srcname: calcmean(data=trial) #+begin_src R mean(data) #+end_src #+results: calcmean : 6.5 or alternative syntax #+begin_src R :var data=trial mean(data) #+end_src #+results: : 6.5 > > #+resname: > > error in buffer "source block produced no output" > > * meantest2 > #+begin_src R > mean(x) > #+end_src > > #+resname: > > error in buffer "source block produced no output" > > > _______________________________________________ > 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