Cryptic error message in emacs org-mode following attempted export of file containing image-generating block of R code
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, http://xahlee.org/emacs/elisp_byte_compile_problem.html 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
