Set the R prompt dynamically, from a function.
Useful links:
https://github.com/gaborcsardi/prompt
Report bugs at https://github.com/gaborcsardi/prompt/issues