Find windows user name within R

后端 未结 3 1548
别跟我提以往
别跟我提以往 2021-02-01 15:55

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)

相关标签:
3条回答
  • 2021-02-01 16:24

    You can do

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

    And if you just type

    Sys.getenv()
    

    you will see all available environment variables.

    0 讨论(0)
  • 2021-02-01 16:33

    If you know how to do it at your system console, the answer would generally be:

    system("...that_string...")
    
    0 讨论(0)
  • 2021-02-01 16:47

    I prefer this

    Sys.info()[["user"]]
    
    0 讨论(0)
提交回复
热议问题