Splitting text to words with R and cSplit()

后端 未结 1 592
死守一世寂寞
死守一世寂寞 2020-12-11 22:30

I\'m trying to split a series of sentences into separate words, that is to tokenize the text.

I have found an R package splitstackshape that is able to

相关标签:
1条回答
  • 2020-12-11 22:41

    The cSplit function returns a data.table.

    What you are describing is the default print behavior for data.tables. To see this in action, try the following:

    library(data.table)
    as.data.table(airquality)
    print(as.data.table(airquality))
    
    print(as.data.table(airquality), nrows = Inf)
    

    Thus, to get the full table displayed, you can try:

    library(splitstackshape)
    print(cSplit(data, "text", " ", "long"), nrows = Inf)
    
    0 讨论(0)
提交回复
热议问题