I use a lot of messages e.g. message("dadida")
in one of my projets, and it is becomming annoying to see all this red text everywhere, always making me wonder if there's an error or a warning hidden somewhere.
I need those messages in the end product so I can't just remove them. But if there was a way to make messages, warnings and errors appear in different colors in the console, that would solve my problem. I haven't found a way to do this.
Edit
Thanks all for your input. I hadn't realized that the red color for all those types of messages was specific to RStudio. In the RGui, all is just plain white text. If customizing the colors is not feasible in RGui, maybe it is in RStudio?
While I am not aware of a way of customizing the output in RGui or RStudio for Windows, using cat() instead of message() will avoid the red text in RStudio. Instead of using
message("Hello!")
use
cat("Hello!\n")
(note the \n that is needed to get a new line).
There are some subtle differences between message() and cat(), which may be relevant when you are redirecting your output e.g. to a LaTeX document using Sweave, so cat() may not be a suitable substitute in all settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With