2

我有一个生成图像的 R 代码块(见下文)。执行代码没有问题(即,块内的 Cc Cc 会按预期生成图像 temp.png)。但是,通过 LaTeX 导出到 PDF 时,会出现错误消息:

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

对这个错误的唯一其他引用(没有关于 sha1 的一点)来自这里, http: //xahlee.org/emacs/elisp_byte_compile_problem.html在一个非常不同的上下文中。

代码块紧跟上一个问题Embedding R plots in Latex via org-mode中的示例代码如下 :

#+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   

更新:组织模式和 emacs 版本

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
4

1 回答 1

2

在得知 G.Jay Kerns 无法使用较新版本的 Emacs 进行复制后,我升级到 Emacs 24.0.91.1 并解决了问题。FWIW,https: //superuser.com/questions/296013/how-do-i-upgrade-emacs-to-the-current-version-on-ubuntu有关于如何从证明有用的存储库构建 Emacs 的简短教程。

于 2012-02-05T06:41:21.393 回答