Carl Carl - 2 months ago 15
R Question

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?

Answer

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")
Comments