Check if code is running remotely and react accordingly.

check_host(auto_connect = FALSE, verbose = FALSE)

Arguments

auto_connect

Set to TRUE if you want the function to create an ssh session (if necessary).

verbose

Set this to TRUE for verbose messages from the function.

Value

TRUE if a remote session is detected, FALSE otherwise.

Details

The function will (optionally) attempt a connection if necessary, and stores it in a global variable (ssh_session).

Examples

check_host(auto_connect=TRUE)
#> [1] FALSE