텍스트가있는 데이터 프레임에서 tm()을 사용하려하지만이 오류는 계속 나타납니다 : "Error in if (vectorized && (length <= 0)) stop("vectorized sources must have positive length") : missing value where TRUE/FALSE needed"
tm() : "(벡터화 된 && (길이가 = 0)) 경우 오류"
person sex adult state code
1 sam m 0 Computer is fun. Not too fun. K1
2 greg m 0 No it's not, it's dumb. K2
3 teacher m 1 What should we do? K3
4 sam m 0 You liar, it stinks! K4
5 greg m 0 I am telling the truth! K5
6 sally f 0 How can we be certain? K6
7 greg m 0 There is no way. K7
8 sam m 0 I distrust you. K8
9 sally f 0 What are you talking about? K9
10 researcher f 1 Shall we move on? Good then. K10
11 greg m 0 I'm hungry. Let's eat. You already? K11
나는 단지이 코드를 사용 :
나는 다음과 같습니다 데이터 프레임이library(tm)
texts <- as.data.frame(texts)
mycorpus<- Corpus(DataframeSource(texts))
사람이 잘못 여기에 무슨 일이 일어나고 있는지에 대한 아이디어를 가지고 있습니까? 미리 많은 감사드립니다! 당신이 (우리의 문안의 컬럼의 코퍼스을해야하고 어떤 당신이 것, 상태 코드 열이 병합 될 것으로 보인다처럼
귀하의 질문에 [예제 데이터] (http://stackoverflow.com/q/5963269/1036500)를 추가하면 사람들이 쉽게 당신을 도울 수 있습니다. 'dput (head (text))'에서 질문을 편집하고 붙여 넣으십시오. – Ben