Cannot find the .Rprofile file.

I want to add some settings to my .Rprofile. However, I can not find the file.

Many said that it is in my folder ~ /. I hid all my hidden files and didn't seem to find them. Also looked at R.Frameworks.

Do not find anything. I assume that I have one, since R works and works fine.

Any other search methods?

My system is Mac OSX 10.8, R 3.0, RStudio

+8
r rstudio osx-mountain-lion
source share
4 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 get rid of a) the ability to overwrite an existing file that you did not find; b) tinker with how Finder hides / shows system files; c) problems with overly sharp text editors / OSs that insist on adding file extensions or do not like system files.

+11
source share

since you are using OS X:

in a text editor -

  • new file
  • enter everything you would like to have in your rprofile
  • Format> Make plain text (or CMD + SHIFT + T)
  • Save file ** IMPORTANT: deselect to add ".txt"
  • Save the file as .Rprofile (it will give you a warning, say yes)
+1
source share

Terminal:

 cd <wherever your R stuff is> [enter] grep -r "some_string_you_know_exists_in_.Rprofile" [enter] 

This will recursively look for the directory and all subdirectories for any files containing the string in quotes

0
source share

The .Rprofile file may not exist. It is not necessary. If it exists, Finder.app hides it (and also hides the .Ristory file), since it considers it a "system file." You can force Finder.app to always display system files by doing this in a terminal session. (This is how I launch my box.) I think you have already done something like this?

 defaults write com.apple.Finder AppleShowAllFiles YES # After running <pt>-<click-hold> on Dock-Finder-icon, choose relaunch 

Doing this requires the discipline of never deleting system files unless you really know all their dependencies. You can then create the .Rprofile file and edit it when you want to add something. A return to the safe version will use an obvious modification.

0
source share

All Articles