Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check if a program is installed

Tags:

r

pandoc

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)?

like image 716
Tyler Rinker Avatar asked Feb 19 '13 18:02

Tyler Rinker


People also ask

How do I see installed program files?

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.

How do I list installed programs from the Windows command prompt?

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.


1 Answers

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
like image 115
agstudy Avatar answered Oct 16 '22 21:10

agstudy