How to filter meta data by user-defined statements in R?
问题 There is a function called sFilter in R to filter meta data. However, the function is an old (Version: 0.5-10) tm package. Is there any function instead of it in a new version? My code block is; query <- "LEWISSPLIT == 'TRAIN'" trainData <- tm_filter(Corpus, FUN = sFilter, query) It means, get documents which have "TRAIN" value in their LEWISSPLIT attribute. <REUTERS TOPICS=?? LEWISSPLIT=?? CGISPLIT=?? OLDID=?? NEWID=??> 回答1: Just write your own filtering function: trainData <- tm_filter