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.

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

Value

A logical(1) or character(1) containing the 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 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.

Examples

has_4ti2()
#> [1] TRUE
if (has_4ti2()) get_4ti2_path()
#> [1] "/Applications/latte/bin"
has_latte()
#> [1] TRUE
if (has_4ti2()) get_latte_path()
#> [1] "/Applications/latte/bin"
# 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()
#> [1] "/path/to/latte"
if (had_latte) set_latte_path(old_latte_path) get_latte_path()
#> [1] "/Applications/latte/bin"