Check if R is running in RStudio

前端 未结 9 698
小鲜肉
小鲜肉 2020-12-09 01:46

I am looking for a way to test if R is being run from RStudio. For some reason I could find the answer on google yesterday but not today, but I think it had to do with testi

9条回答
  •  心在旅途
    2020-12-09 02:31

    To add to the number of nice guesses, here is a message from 2011 (Ice Age)

    http://support.rstudio.org/help/discussions/problems/413-location-of-installed-packages

    if (Sys.getenv("RSTUDIO_USER_IDENTITY")!= ""){
    .libPaths(.Library) # Avoid additional libraries } else { # not rstudio ...
    

提交回复
热议问题