1

I'm going through Chamber's "Programming With Data: A Guide to the S Language", and I'm trying to get my prompt to display the data. For example, instead of "R> ", I would have "Nov 17: ".

I have created an .Rprofile and added the following:

options(prompt=system("date '+%b %e: '"))

However, when I run an R session I get this:

Nov 17: 
0
0
0

Is there a way to get this to work? Thanks

Edit 1: My version of R is 3.0.0 and I'm using ubuntu 12.04

wespiserA
  • 3,131
  • 5
  • 28
  • 36

2 Answers2

4

This is simple:

options(prompt=paste(Sys.Date(),"> "))
Thomas
  • 43,637
  • 12
  • 109
  • 140
3

Similar to the solution by Thomas, but formatted like you want

> options(prompt=strftime(Sys.Date(),"%b %e: "))
Nov 17:
Andy Barbour
  • 8,783
  • 1
  • 24
  • 35