Is there a way to get the current windows user name or the windows home within an R session?
Thanks.
(Sorry, if I missed something, but I couldn't find anything)
You can do
Sys.getenv("USERNAME")
Sys.getenv("HOME")
And if you just type
Sys.getenv()
you will see all available environment variables.
If you know how to do it at your system console, the answer would generally be:
system("...that_string...")
If you're looking for the path to the current user's home directory, try:
> dirname("~")
[1] "C:/Users/username