pathing: Set paths to LattE and 4ti2 executables

pathingR Documentation

Set paths to LattE and 4ti2 executables

Description

These are helper functions that deal with pathing to external programs and asking if they are present. When latte is loaded it attempts to find LattE and 4ti2 executables by looking for environment variables specifying them, i.e. their paths as specified in your .Renviron file.

Usage

set_latte_path(path)

set_4ti2_path(path)

get_4ti2_path()

get_latte_path()

has_4ti2()

has_latte()

missing_4ti2_stop()

missing_latte_stop()

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

For easiest use, you'll want to specify the paths of LattE and 4ti2 executables in your ⁠~/.Renviron⁠ file. They should look something like

⁠LATTE=/Applications/latte/bin⁠

⁠FOURTITWO=/Applications/latte/bin⁠

You can set these permanently with usethis::edit_r_environ().

You can change these for the current session using, e.g., set_latte_path(), which accepts a character string or, if missing, uses file.choose() to let you interactively; you just select an arbitrary executable.

Value

A logical(1) or character(1) containing the path.

Author(s)

David Kahle david@kahle.io

Examples



has_4ti2()
if (has_4ti2()) get_4ti2_path()

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


# you can set these paths permanently with the following. note that you'll 
# need to re-start the R session afterwards or simply pass the path into, 
# e.g., set_latte_path(). see below for more details on that.
if (interactive()) edit_r_environ()


# you can change these in your current session with set_latte_path() and
if (had_latte <- has_latte()) old_latte_path <- get_latte_path()
set_latte_path("/path/to/latte")
get_latte_path()

if (had_latte) set_latte_path(old_latte_path)
get_latte_path()


latte documentation built on June 9, 2025, 9:08 a.m.

Related to pathing in latte...