MyNixOS website logo
Description

Detection and Localization of Executable Files.

A set of functions to locate some programs available on the user machine. The package provides functions to locate 'Node.js', 'npm', 'LibreOffice', 'Microsoft Word', 'Microsoft PowerPoint', 'Microsoft Excel', 'Python', 'pip', 'Mozilla Firefox' and 'Google Chrome'. User can test the availability of a program with eventually a version and call it with function system2() or system(). This allows the use of a single function to retrieve the path to a program regardless of the operating system and its configuration.

locatexec

R buildstatus

The package aims to allow the localization of external programs such as “python”, “Google Chrome”, “node.js” and “LibreOffice” in order to be able to easily call them from R.

This makes it easier to call these programs from R from various operating systems.

library(locatexec)

if(exec_available("node")){
  message(exec_version("node"))
  message(node_exec())
}
#> 12.16.0
#> C:/Program Files/nodejs/node.exe
execexec_funavailableversionpath
nodenode_exec()TRUE12.16.0C:/Program Files/nodejs/node.exe
chromechrome_exec()TRUE89.0.4389.82C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
pythonpython_exec()TRUE3.9.1C:/Users/dgohe/AppData/Local/Programs/Python/Python39/python.exe
libreofficelibreoffice_exec()TRUE7.1.0.3C:/Program Files/LibreOffice/program/soffice.com
excelexcel_exec()TRUE16C:/Program Files/Microsoft Office/root/Office16/EXCEL.exe
powerpointpowerpoint_exec()TRUE16C:/Program Files/Microsoft Office/root/Office16/POWERPNT.exe
pippip_exec()TRUE20.2.3C:/Users/dgohe/AppData/Local/Programs/Python/Python39/Scripts/pip.exe
firefoxfirefox_exec()TRUE86.0.1C:/Program Files/Mozilla Firefox/firefox.exe
npmnpm_exec()TRUE6.13.4C:/Program Files/nodejs/npm.cmd
wordword_exec()TRUE16C:/Program Files/Microsoft Office/root/Office16/WINWORD.exe

Motivations

This was motivated by the need for tools similar to rmarkdown::pandoc_available() and rmarkdown::pandoc_exec() but allowing to locate external programs other than pandoc.

I need to use these programs from R without having heavy dependencies. These functions will mainly be used to automate some visual tests or to improve the documentation of other packages.

Installation

You can install the CRAN version with:

install.packages("locatexec")

Related work

  • Packages pagedown is providing find_chrome() for finding “Google Chrome”.

  • Packages findpython is providing find_python_cmd() for finding "python".

  • If you want to go deeper with ‘R’ and ‘node.js’, I recommend package packer.

  • If you want to go deeper with ‘R’ and ‘Python’, I recommend package reticulate.

Metadata

Version

0.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows