powered by
Tries the LOGNAME, USER, LNAME, USERNAME environment variables first. Then it tries the id command on Unix-like platforms and whoami on Windows.
LOGNAME
USER
LNAME
USERNAME
id
whoami
username(fallback = NULL)
If not NULL then this value is returned if the username cannot be found, instead of triggering an error.
NULL
The user name of the current user.
Other user names: email_address, fullname, gh_username, whoami
email_address
fullname
gh_username
# NOT RUN { username() # }
Run the code above in your browser using DataLab