Last data update: 2014.03.03

R: User name of the current user
usernameR Documentation

User name of the current user

Description

Tries the LOGNAME, USER, LNAME, USERNAME environment variables first. Then it tries the 'id' command on Unix-like platforms and 'whoami' on Windows.

Usage

username(fallback = NULL)

Arguments

fallback

If not NULL then this value is returned if the username cannot be found, instead of triggering an error.

Value

The user name of the current user.

See Also

Other user.names: email_address; fullname; gh_username; whoami

Examples

## Not run: 
username()

## End(Not run)

Results