我问一个相关的问题:从回答,直到我在所有三个系统测试自己的解决方案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