在R中将Double(“)替换为Single Straight line Quote(')

时间:2017-10-16 17:21:04

标签: r quote

我有以下ID,并希望用一条直线引号(')替换双引号(“)。

ID<-c("1WK7X6", "TQM6VY", "ZDNZX0", "J495D8", "RGNSW", 
"9ZD31", "9JS84", "NTHDJ4", "H2UA1", "AV9N7", 
"DC5F2B6", "SLL2C2", "MB2Q0", "9C94LR", "KZNFS0", 
"WHBH47", "BHPW9", "CH2TD5", "TN8F", "XHCQ41"

1 个答案:

答案 0 :(得分:1)

可以打印var b = true; Console.WriteLine(b ? (!(b = false) ? "active" : "") : ""); // prints "active" Console.WriteLine(b ? (!(b = false) ? "active" : "") : ""); // prints "" Console.WriteLine(b ? (!(b = false) ? "active" : "") : ""); // prints "" 的结果吗?如果它是一个字符向量,那么双引号是无关紧要的,因为它仅用于表示每个元素都是一个字符。