2

I have an R code block that generates an image (see below). Executing the code is no problem (i.e., C-c C-c from within the block generates an image temp.png as expected). However, on export to PDF via LaTeX, there is an error message:

org-babel-sha1-hash: Wrong number of arguments: called-interactively-p, 1

The only other reference to this error (sans the bit about sha1) is from here, Link in a very diffirent context.

The code block closely follows the example from this previous question Embedding R plots in Latex via org-mode Here's the code:

#+NAME: optimal_applications 
#+BEGIN_SRC R  :results graphics :file temp.png :exports both  
require(ggplot2) 
c <- c(.01, .05, .10) 
df <- data.frame(q =
  rep((0:100)/100, length(c)), 
c = c(sapply(c, function(x) rep(x,  101))) )

df$s.star <- with(df, log(-c/log(1-q))/log(1-q))
df$s.star[df$s.star < 0] <- 0

g <- ggplot(df, aes(x = q, y = s.star, colour=factor(c))) + geom_line(aes(group=factor(c))) +
    xlab("Probability that an application is successful") +
    ylab("Optimal number of applications to send")
print(g) 
#+END_SRC   

Update: org-mode & emacs version

Org-mode version 7.8.03 (release_7.8.03.267.g1c8eb)
GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.4) of 2011-04-04 on crested, modified by Debian
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
John Horton
  • 4,122
  • 6
  • 31
  • 45
  • I think Its not at all related to `R`, But IIRC its backward incomparable change in emacs 24. full debugger message would help to see where is the problem. and please update which version of emacs and org-mode you are using – kindahero Feb 04 '12 at 19:19
  • Thanks - done. Do you think running emacs 24 might be a solution? – John Horton Feb 04 '12 at 21:36
  • 1
    I just tried your example and it works for me just fine. Your org is newer than mine (release_7.8.02.58.g013b) but my Emacs is newer than yours (23.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.5) of 2011-08-14 on rothera, modified by Debian). – G. Jay Kerns Feb 05 '12 at 02:52

1 Answers1

2

After learning that G.Jay Kerns couldn't reproduce with a newer version of Emacs, I upgraded to Emacs 24.0.91.1 and the problem was resolved. FWIW, https://superuser.com/questions/296013/how-do-i-upgrade-emacs-to-the-current-version-on-ubuntu has short tutorial on how to build Emacs from the repository that proved useful.

Community
  • 1
  • 1
John Horton
  • 4,122
  • 6
  • 31
  • 45