emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] how do scientists use org mode?


From: Nick Dokos
Subject: Re: [O] how do scientists use org mode?
Date: Thu, 02 Feb 2012 00:10:17 -0500

Christopher W. Ryan <address@hidden> wrote:

> Thanks everyone for the advice and ideas. I see lots of potential, and 
> also lots to learn.
> 
> I made my first attempt at an R code block in an Org file. I'm running 
> Ubuntu 10.04 LTS. Synaptic tells me that I have emacs 23.1+1-4ubuntu7.2, 
> and Org 6.34c-1.
> 
> I added this to my .emacs:
> 
> ;; active Babel languages
> (org-babel-do-load-languages
>   'org-babel-load-languages
>   '((R . t)
>     ))
> 
> Here is the source block:
> 
> #+begin_src R
> getwd()
> dd <- read.csv("cars.csv", sep=",", header=TRUE)
> head(dd)
> str(dd)
> dd$date <- as.Date(as.character(dd$Date), format="%d-%b-%y")
> names(dd)[4] <- "city"
> table(is.na(dd$date))
> min(dd$date, na.rm=TRUE); max(dd$date, na.rm=TRUE)
> #+end_src
> 
> emacs seems to do the syntax highlighting properly, so I guess it is 
> recognizing this as a code block.
> 
> When I put point inside the block and type C-c C-c, emacs gives me this 
> message:
> 
> C-c C-c can do nothing useful at this location.
> 
> I wonder if I have Babel? Is it "built in" to the emacs or Org versions 
> that I have?
> 

You probably have babel, but not the ob-R.el module - that came in 6.36+:

,----
| $ git blame -L1,1 lisp/ob-R.el
| 07388931 lisp/babel/langs/ob-R.el (Eric Schulte 2010-06-11 16:02:42 -0700 1) 
;;; ob-R.el --- org-babel functions for R code evaluation
| $ git describe 07388931
| release_6.36-324-g0738893
`----

You can use some other language (elisp, shell, python probably all
existed in 6.34). But you will be happier I think with a more recent
version of org: visit http://orgmode.org/org-mode-download.html
and choose your poison.

o Many people update to the latest development version fairly frequently,
  using git.

o Many others use the standard distribution (7.8.03 as of this writing):
  download a .zip or .tgz file and install it.  Alternatively, you can
  use the Emacs package manager (ELPA): there are several entries in the
  FAQ

    
http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development

  that describe these methods in more detail.

o Many others use whatever is bundled with their emacs (invariably an
  ancient org version that causes problems to everybody involved: org-mode
  is moving very fast).

Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]