我問一個相關的問題:從回答,直到我在所有三個系統測試自己的解決方案check if a program is installedR不承認Pandoc Linux Mint的
,但我剋制。我可以得到pandoc於從R內工作的Windows機器上,但在Linux上我獲得從R終端的每個方法此錯誤/響應:
1:
> system('pandoc -v')
sh: 1: pandoc: not found
2:
> myPaths <- c("pandoc",
+ "~/.cabal/bin/pandoc",
+ "~/Library/Haskell/bin/pandoc",
+ "C:\\PROGRA~1\\Pandoc\\bin\\pandoc")
> Sys.which(myPaths)
pandoc ~/.cabal/bin/pandoc
"" "/home/tyler/.cabal/bin/pandoc"
~/Library/Haskell/bin/pandoc C:\\PROGRA~1\\Pandoc\\bin\\pandoc
"" ""
3:
> Sys.which("pandoc")
pandoc
""
你可能會認爲我沒有pandoc安裝和路徑上,但我相信我做的。從一個乾淨的終端會話:
> [email protected] ~ $ echo $PATH
> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/tyler/.cabal/bin
和
[email protected] ~ $ pandoc -v
pandoc 1.10.1
Compiled with citeproc-hs 0.3.7, texmath 0.6.1.3, highlighting-kate 0.5.3.6.
Syntax highlighting is supported for the following languages:
Actionscript, Ada, Alert, Alert_indent, Apache, Asn1, Asp, Awk, Bash,
Bibtex, Boo, C, Changelog, Clojure, Cmake, Coffee, Coldfusion, Commonlisp,
Cpp, Cs, Css, Curry, D, Diff, Djangotemplate, Doxygen, Doxygenlua, Dtd,
Eiffel, Email, Erlang, Fortran, Fsharp, Gnuassembler, Go, Haskell, Haxe,
Html, Ini, Java, Javadoc, Javascript, Json, Jsp, Julia, Latex, Lex,
LiterateCurry, LiterateHaskell, Lua, Makefile, Mandoc, Matlab, Maxima,
Metafont, Mips, Modula2, Modula3, Monobasic, Nasm, Noweb, Objectivec,
Objectivecpp, Ocaml, Octave, Pascal, Perl, Php, Pike, Postscript, Prolog,
Python, R, Relaxngcompact, Rhtml, Ruby, Scala, Scheme, Sci, Sed, Sgml, Sql,
SqlMysql, SqlPostgresql, Tcl, Texinfo, Verilog, Vhdl, Xml, Xorg, Xslt, Xul,
Yacc, Yaml
Copyright (C) 2006-2013 John MacFarlane
Web: http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
我怎樣才能使R於Linux Mint的認識pandoc?(我是Linux新手)
適用於Ubuntu 12.04。但是我在/ usr/bin /中有pandoc。 – EDi 2013-02-19 21:54:00
Dito。 'system(「pandoc」)'返回'/ usr/bin/pandoc'。我認爲你在那裏過分複雜。這不是Windows。一旦你安裝了一個二進制文件,「它就在那裏」。 – 2013-02-19 21:55:28
我試圖通過cabal更新來使用更新版本的pandoc,見[這裏](http://johnmacfarlane.net/pandoc/installing.html)。然而它在那個頁面上說它把它放在'〜/ .cabal/bin'中。我想如果我把這些文件放到'usr'目錄下,它會按預期工作,但我不知道哪裏可以找到usr目錄。然而,使用'sudo apt-get install pandoc'它現在可以在R上運行。 – 2013-02-20 00:11:14