Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.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,在整个过程中: library("spacyr") library("dplyr", warn.conflicts = FALSE) mytext <- data.frame(text = c("test text", "section 2 sending"), id = c(32,41)) 易于使用tidyr库 mytext#一个tible:5 x 2 #>文本id #> #>1测试32 #>

在整个过程中:

library("spacyr")
library("dplyr", warn.conflicts = FALSE)

mytext <- data.frame(text = c("test text", "section 2 sending"), id = c(32,41))

易于使用
tidyr

mytext#一个tible:5 x 2
#>文本id
#>      
#>1测试32
#>2文本32
#>3第41节
#> 4 2          41
#>5发送41

使用
tidyr
库很容易

mytext#一个tible:5 x 2
#>文本id
#>      
#>1测试32
#>2文本32
#>3第41节
#> 4 2          41
#>5发送41

我们可以使用
cSplit

library(splitstackshape)
cSplit(mytext, "text", sep=" ", "long")
#      text id
#1:    test 32
#2:    text 32
#3: section 41
#4:       2 41
#5: sending 41

我们可以使用
cSplit

library(splitstackshape)
cSplit(mytext, "text", sep=" ", "long")
#      text id
#1:    test 32
#2:    text 32
#3: section 41
#4:       2 41
#5: sending 41