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です。

コードブロックは、この前の質問の例に厳密に従います。org-modeを介してラテックスにRプロットを埋め込むコードは次のとおり です。

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

更新: org-mode&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 に答える