whoami: User name and full name of the current user

View source: R/whoami.R

whoamiR Documentation

User name and full name of the current user

Description

Calls username and fullname.

Usage

whoami()

Details

For the username it tries the LOGNAME, USER, LNAME and USERNAME environment variables first. If these are all unset, or set to an empty string, then it tries running id on Unix-like systems and whoami on Windows.

For the full name of the user, it queries the system services and also tries the user's global git configuration. On Windows, it tries finding the global git configuration in Sys.getenv("USERPROFILE") if it doesn't find it in Sys.getenv("HOME") (often "Documents").

For the email address it uses the user's global git configuration. It tries finding the global git configuration in Sys.getenv("USERPROFILE") if it doesn't find it in Sys.getenv("HOME").

For the GitHub username it uses the GITHUB_USERNAME environment variable then it tries searching on GitHub for the user's email address.

Value

A named character vector with entries: username, fullname, email_address, gh_username.

See Also

Other user names: email_address(), fullname(), gh_username(), username()

Examples

## Not run: 
whoami()

## End(Not run)

gaborcsardi/whoami documentation built on Nov. 3, 2023, 10:52 p.m.