I'm writing a function that uses pandoc in R through the command line. How can I use R to check if pandoc installed (I also assume it would have to be on the path which may be an issue for windows users)?
List Installed Programs Using Settings. Press Windows key + I to open Settings and click Apps > Apps & features. Doing so will list all programs installed on your computer, along with the Windows Store apps that came pre-installed.
In an open PowerShell window or command line terminal with administrative privileges, type wmic. Once the WMIC prompt opens, type /output:C:\list. txt product get name, version then hit enter.
I don't have pandoc to install , but generally I test if a program is installed like this :
pandoc.installed <- system('pandoc -v')==0
For example to test if java is installed:
java.installed <- system('java -version') ==0
java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
> java.installed
[1] TRUE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With