pathing: Set paths to LattE and 4ti2 executables

Description Usage Arguments Details Value Author(s) Examples

Description

These functions set the path to external programs either by (1) passing them a character string or (2) using file.choose().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15

Arguments

path

A character string, the path to a 4ti2 function (e.g. markov) for setting 4ti2's path or a LattE function (e.g. count) for LattE's path

Details

When latte is loaded it attempts to find LattE and 4ti2 executables (represented by count and markov, respectively). How it looks depends on your operating system.

If you're using a Mac or Linux machine, it looks based on your system's path. Unfortunately, R changes the system path in such a way that the path that R sees is not the same as the path that you'd see if you were working in the terminal. (You can open the Terminal app on a Mac by going to /Applications/Utilities/Terminal.) Consequently, latte tries to guess the file in which your path is set. To do so, it first checks if your home directory (type echo ~/ in the terminal to figure out which directory this is if you don't know) for the file named .bash_profile. If this file is present, it runs it and then checks your system's path variable (echo $PATH). If it's not present, it does the same for .bashrc and then .profile. In any case, once it has its best guess at your path, it looks for "latte".

On Windows, latte just uses Sys.which() on "whereis" to On Windows, latte just uses Sys.which() on "whereis" to determine where the executables count and markov are (for LattE and 4ti2, respectively).

Value

An invisible character string, the path found. More importantly, the function has the side effect of setting the option "latte_path" or "4ti2_path"

Author(s)

David Kahle david@kahle.io

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
has_4ti2()
if (has_4ti2()) get_4ti2_path()

has_latte()
if (has_4ti2()) get_latte_path()

# these are stored in your .Renviron file; that's where you should put the 
# path to LattE and 4ti2 executables. for example, you should have a lines 
# that look like
# LATTE=/Applications/latte/bin
# 4TI2=/Applications/latte/bin
# you can set these with usethis::edit_r_environ() 

# you can change these in your current session with set_latte_path() and 
# set_4ti2_path(), for example set_4ti2_path("/path/to/4ti2")

latte documentation built on May 1, 2019, 7:29 p.m.

Related to pathing in latte...