username: User name of the current user

Description Usage Arguments Value See Also Examples

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

1
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

1
2
3
4
## Not run: 
username()

## End(Not run)

Example output

[1] "anon"

whoami documentation built on May 2, 2019, 9:24 a.m.

Related to username in whoami...