I try to create a matrix, for this I would like to tolower text. For this I use this R instruction :
matrix = create_matrix(tweets[,1], toLower = TRUE, language="english",
removeStopwords=FALSE, removeNumbers=TRUE,
stemWords=TRUE)
Here the R code :
library(RTextTools)
library(e1071)
pos_tweets = rbind(
c('j AIME la voiture', 'positive'),
c('cette machine est performante', 'positive'),
c('je me sens en bonne forme ce matin', 'positive'),
c('je suis super excitée d aller voir le spectacle de demain', 'positive'),
c('il est mon meilleur ami', 'positive')
)
neg_tweets = rbind(
c('je séteste cette voiture', 'negative'),
c('ce film est horrible', 'negative'),
c('je suis fatiguée ce matin', 'negative'),
c('je déteste ce concert', 'negative'),
c('il n est pas mon ami', 'negative')
)
test_tweets = rbind(
c('je suis heureuse ce matin', 'negative'),
c('un bon ami', 'negative'),
c('je me sens triste', 'positive'),
c('pas belle cette maison', 'negative'),
c('mauvaise chanson', 'negative')
)
tweets = rbind(pos_tweets, neg_tweets, test_tweets)
# build dtm
matrix= create_matrix(tweets[,1], toLower = TRUE, language="french",
removeStopwords=FALSE, removeNumbers=TRUE,
stemWords=TRUE)
The problem that I remark that there is words with capital letters in the matrix.
Can you explain to me please why I get this problem?
Thank you