Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在R中的某些元素中用分号展开向量_R - Fatal编程技术网

在R中的某些元素中用分号展开向量

在R中的某些元素中用分号展开向量,r,R,假设R中有一个向量: x<-c("a", "b", "c;d", "e", "f;g;h;i;j") 带strsplit的 unlist(strsplit(x, split = ";")) # [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" unlist(strsplit(x, split = ";")) # [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"

假设R中有一个向量:

x<-c("a", "b", "c;d", "e", "f;g;h;i;j")

带strsplit的

unlist(strsplit(x, split = ";"))
# [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
unlist(strsplit(x, split = ";"))
# [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"