tm: read in data frame, keep text id's, construct DTM and join to other dataset

前端 未结 5 1553
半阙折子戏
半阙折子戏 2020-12-29 11:48

I\'m using package tm.

Say I have a data frame of 2 columns, 500 rows. The first column is ID which is randomly generated and has both character and number in it: \"

5条回答
  •  长发绾君心
    2020-12-29 12:27

    I come up with this problem too, for the needs of changing the id of each content, I suggest use this code

    for(k in 1:length(mycorpus))
    {
      mycorpus[[k]]$meta$id <- mycorpus$ID[k]
    }
    

提交回复
热议问题