Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用以下命令生成类似“我想测试\ttab”的输出,但输出是“我想测试选项卡”。我希望 \t 在那里而不是被解释为制表符分隔符。有没有办法做到这一点?任何人都可以帮忙吗?非常感谢您!
sink(paste("test","sh",sep=".")) cat(paste0("I want to test","\t","tab")) cat("\n") sink()
谢谢,R
只需添加一个额外的斜杠即可转义以下特殊字符:
cat(paste0("I want to test","\\t","tab")) cat("\n")