【发布时间】:2018-07-10 15:27:20
【问题描述】:
这是我使用的源代码:
MyData <- Corpus(DirSource("F:/Data/CSV/Data"),readerControl = list(reader=readPlain,language="cn"))
SegmentedData <- lapply(MyData, function(x) unlist(segmentCN(x)))
temp <- Corpus(DataframeSource(SegmentedData), readerControl = list(reader=readPlain, language="cn"))
预处理数据
temp <- tm_map(temp, removePunctuation)
temp <- tm_map(temp,removeNumbers)
removeURL <- function(x)gsub("http[[:alnum:]]*"," ",x)
temp <- tm_map(temp, removeURL)
temp <- tm_map(temp,stripWhitespace)
dtmxi <- DocumentTermMatrix(temp)
dtmxi <- removeSparseTerms(dtmxi,0.83)
**inspect(t(dtmxi))** ---This is where I get the error
【问题讨论】:
标签: r text-mining