R bloggers

Coloured output in the R console

FavoriteLoadingAdd to favorites

Just a little fun today… the R console isn’t the most interesting of things… text is typically either black or red (assuming default settings in RStudio). There’s a package though called crayon which allows one to change the style of text in terms of colour, background and some font-type settings. It could be an interesting way to spice up summaries (I’m not recommending it, but it’s a possibility. As far as packages are concerned, it’s just another dependency…)… devtools::install_github(“r-lib/crayon”) library(crayon) cat(green( ‘I am a green line ‘ %+% blue$underline$bold(‘with a blue substring’) %+% yellow$italic(‘ that becomes yellow and italicised!n’) )) Related R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time…
Original Post: Coloured output in the R console