Sys.info {base} | R Documentation |
Reports system and user information.
Sys.info()
This function is not implemented on all R platforms, and returns
NULL
when not available. Where possible it is based on POSIX
system calls. (Under Windows, it is obtained by Windows system
calls and the last three values are the same.)
Sys.info()
returns details of the platform R is running on,
whereas R.version
gives details of the platform R was
built on: they may well be different.
A character vector with fields
sysname |
The operating system. |
release |
The OS release. |
version |
The OS version. |
nodename |
A name by which the machine is known on the network (if any). |
machine |
A concise description of the hardware. |
login |
The user's login name, or |
user |
The name of the real user ID, or |
effective_user |
The name of the effective user ID, or
|
The meaning of OS ‘release’ and ‘version’ is system-dependent and there is no guarantee that the node or login or user names will be what you might reasonably expect. (In particular on some Linux distributions the login name is unknown from sessions with re-directed inputs.)
The use of alternatives such as system("whoami")
is not
portable: the POSIX command system("id")
is much more portable
on Unix-alikes, provided only the POSIX options are used (and not the
many GNU extensions).
.Platform
, and R.version
.
sessionInfo()
gives a synopsis of both your system and
the R session.
Sys.info() ## An alternative (and probably better) way to get the login name on Unix Sys.getenv("LOGNAME")