简体   繁体   中英

How do I update my .RProfile on RStudio Server

I installed the free rstudio server on a digital ocean server. I got everything going, but I wanted to customize my .RProfile.

I ran:

candidates <- c( Sys.getenv("R_PROFILE"),
                 file.path(Sys.getenv("R_HOME"), "etc", "Rprofile.site"),
                 Sys.getenv("R_PROFILE_USER"),
                 file.path(getwd(), ".Rprofile") )

file.edit(Filter(file.exists, candidates))

Which opened the file in RStudio, but it said I didn't have the rights to overwrite it. I shouldn't have to be root to update the RProfile since different users in theory could have different RProfiles.

Does anyone know how to update .RProfiles on R Studio Server?

That command finds an existing .Rprofile to edit. You probably want to create a new .Rprofile for your user account. This should do the job:

file.edit("~/.Rprofile")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM