Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.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,因此,我试图删除318591个字符串向量的停止字 通过这样做,我正在使用这个 X<-lapply(articles_and_id[,2], function(x) { t <- unlist(strsplit(x, " ")) t[t %nin% stopWords] 所以我想把它放回一个数据帧,将它转换成以下形式: 1 new, relictual, highly, troglomorphic, species, tomoce

因此,我试图删除318591个字符串向量的停止字

通过这样做,我正在使用这个

X<-lapply(articles_and_id[,2], function(x) {
   t <- unlist(strsplit(x, " "))
   t[t %nin% stopWords]
所以我想把它放回一个数据帧,将它转换成以下形式:

1                      new, relictual, highly, troglomorphic, species, tomoceridae, collembola, deep, croatian, cave
我正在使用:

  articles_and_id[,2] <- lapply(X,toString)
articles\u和\u id[,2]您可以使用:

 articles_and_id[,2] <- sapply(X,paste, collapse=" ")
articles_和_id[,2]
 articles_and_id[,2] <- sapply(X,paste, collapse=" ")