I want to output a partially colored string. e.g. something like:
print(paste("This is how", style("Red","red", "bold"), "looks."))
[1] "This is how Red looks."
The string Red should be colored in red.
Any help will be much appreciated!!
You can hack it using text:
plot(1:10,1:10,type='n',frame.plot=F,axes=F,xlab="",ylab="")
text(5,1,"This is how")
text(5.8,1,"Red",col='red',font=2)
text(6.3,1,"looks.")

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