Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot locate .Rprofile file [duplicate]

I want to add some customization to my .Rprofile. However, I cannot seem to find the file.

Many have said it is located in my ~/ folder. I have unhidden all my hidden files and do not seem to find it. Also looked in R.Frameworks.

Not finding anything. I assume that I have one, as R fires up and works fine.

Any other search methods?

My system is Mac OSX 10.8, R 3.0, RStudio

like image 330
mpg Avatar asked Jul 03 '13 22:07

mpg


People also ask

Where is my .rprofile file?

Rprofile files live in the base of the user's home directory, and project-level . Rprofile files live in the base of the project directory. R will source only one . Rprofile file.

Where is the .renviron file?

Renviron file is sourced. Typically . Rprofile is located in the users' home directory ( ~/. Rprofile ), however a different location can be configured by setting the R_PROFILE_USER environment variable.


2 Answers

my favorite way would be to open a Terminal window, and type:

touch ~/.Rprofile
open ~/.Rprofile

or

open -a Textedit ~/.Rprofile

this way you save yourself from a) the possibility of overwriting an existing file that you didn't find; b) fiddling with the way the Finder hides/shows system files; c) problems with overzealous text editors/OS that insist on adding file extensions, or don't like system files.

like image 89
baptiste Avatar answered Oct 16 '22 13:10

baptiste


since you are using OS X:

in text edit -

  • new file
  • put in whatever you'd like to have in your rprofile
  • Format > Make Plain Text (or CMD+SHIFT+T )
  • Save File ** IMPORTANT: un-select the option to add ".txt"
  • Save the file as .Rprofile (it will give you a warning, say yes)
like image 44
Ricardo Saporta Avatar answered Oct 16 '22 12:10

Ricardo Saporta