我想输出一个部分着色的字符串。例如类似于:
print(paste("This is how", style("Red","red", "bold"), "looks."))
[1]“这就是红色的样子。”
字符串 Red 应为红色。
任何帮助将不胜感激!!
最佳答案
你可以使用 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.")
关于R - 如何在 R 中输出部分着色的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23145079/