helpers: Helpers to develop easier to understand code.

userR Documentation

Helpers to develop easier to understand code.

Description

A set of lightweight helpers that are often not strictly necessary, but they make code easier to read.

Usage

user(username = NULL)

machine(machinename = NULL)

node(machinename = NULL)

Arguments

username

A character string of a username.

machinename

A character string, which will be used as a partial match via grep, so the entire machine name is not necessary. A user can use regex if needed, e.g., "^machine1" will match "machine15" and "machine12", but not "thisIs_machine1".

Details

node is an alias for machine

Value

if username is non-NULL, returns a logical indicating whether the current user matches the supplied username. Otherwise returns a character string with the value of the current user.

machine returns a logical indicating whether the current machine name Sys.info()[["nodename"]] is matched by machinename.


PredictiveEcology/SpaDES.project documentation built on Dec. 23, 2024, 7:33 a.m.