Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find windows user name within R

Tags:

windows

r

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)

like image 415
Sophia Avatar asked Apr 15 '12 18:04

Sophia


2 Answers

You can do

Sys.getenv("USERNAME") Sys.getenv("HOME") 

And if you just type

Sys.getenv() 

you will see all available environment variables.

like image 65
flodel Avatar answered Sep 17 '22 16:09

flodel


I prefer this

Sys.info()[["user"]] 
like image 37
GSee Avatar answered Sep 17 '22 16:09

GSee