1

I want to change the prompt in R from > to R> and I know I should use the options command options(prompt="...") and it works, but then when I restart R the prompt is back to >.

Is there anyway to save the change so that it sticks?

Paul
  • 1,275
  • 2
  • 18
  • 41
David
  • 11
  • 2

1 Answers1

2

Use .Rprofile file, description

Severin Pappadeux
  • 16,848
  • 3
  • 34
  • 60
  • Thanks for the quick answer. I tried that, to no avail. For many hours, I searched through documentation regarding .Rprofile and tried everything, and the options would never stay. I finally managed to have it work, on OSX, I opened the RStudio package in applications and modified the options.R file I found in there. That worked. If anyone can give me feedback on this approach, I would appreciate it, not sure if what I did was right, even though it worked. – David Feb 04 '16 at 01:08
  • @David Mmm... Just changed my .Rprofile prompt to `options(prompt="QQQ> ", digits=4, show.signif.stars=FALSE)` and typed **R** and prompt was `QQQ>`. Apparently, yours is not read. I have it in my working directory, `C:/Users/XXX/Documents/R/.Rprofile` and it just works – Severin Pappadeux Feb 04 '16 at 03:36
  • @David, aha, I might know why. In Rstudio, Tools->Global Options->General you could set default working directory. So as soon as this directory has .Rprofile, it will be picked up, just checked. Mine set to directory I worte earlier, it has .Rprofile, and all options are picked up – Severin Pappadeux Feb 04 '16 at 03:40
  • Hey thanks for your help! Really I tried to put my .Rprofile file in my working directory and putting the options in there. It just does not seem to work for me. The only way has been to go to Applications/R Studio/Contents/Resources/R/Options.R and modify that file directly. I've haven't read of anyone else who did it this way. – David Feb 05 '16 at 21:12