When using a colored prompt, history navigation using the UP key is buggy. More specifically, R counts the escape sequences into the prompt length, resulting in rubbish text at the begining of the line.
However, this is just a visual nuisance as the actual line content is fine. Simply pressing ENTER clears it.
Interim solution: if this is really annoying, simply use "None" as prompt color.