拆分元素与" |"在向量中

时间:2015-10-16 14:04:14

标签: r split

我想在包含" |" .I的矢量中拆分元素以取消新矢量:

vects<-c("[1] A(+42.01)", "[1] C(+57.02)","[1] C(+57.02)|[10] C(+57.02)")

splits <- unlist(strsplit(vects, split = "|"))

为什么我会得到这个输出?如何正确分割到&#34; |&#34;:

 [1] "[" "1" "]" " " "A" "(" "+" "4" "2" "." "0" "1" ")" "[" "1" "]" " " "C" "(" "+" "5" "7" "." "0" "2" ")" "["
[28] "1" "]" " " "C" "(" "+" "5" "7" "." "0" "2" ")" "|" "[" "1" "0" "]" " " "C" "(" "+" "5" "7" "." "0" "2" ")"

0 个答案:

没有答案