Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

whoami

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

Examples

## Not run: 
whoami()

## End(Not run)

whoami

Username, Full Name, Email Address, 'GitHub' Username of the Current User

v1.3.0
MIT + file LICENSE
Authors
Gábor Csárdi [aut, cre], Maëlle Salmon [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.