How to show corpus text in R tm package?

前端 未结 8 852
一个人的身影
一个人的身影 2020-12-14 23:49

I\'m completely new in R and tm package, so please excuse my stupid question ;-) How can I show the text of a plain text corpus in R tm package?

I\'ve loaded a corpu

8条回答
  •  没有蜡笔的小新
    2020-12-15 00:02

    Here is a simple and direct way to display the text of a corpus:

    strwrap(corpus[[1]])
    

    For the crude data this will output

    [1] "Diamond Shamrock Corp said that effective today it had cut its contract"      
    [2] "prices for crude oil by 1.50 dlrs a barrel.  The reduction brings its posted" 
    [3] "price for West Texas Intermediate to 16.00 dlrs a barrel, the copany said."   
    [4] "\"The price reduction today was made in the light of falling oil product"     
    [5] "prices and a weak crude oil market,\" a company spokeswoman said.  Diamond is"
    [6] "the latest in a line of U.S. oil companies that have cut its contract, or"    
    [7] "posted, prices over the last two days citing weak oil markets.  Reuter"
    

提交回复
热议问题