Everyday R code (15) Text Mining

December 13, 2016 lilo 0

There are several techniques for text mining. Word Cloud https://www.r-bloggers.com/word-cloud-in-r/ Association rule http://www.rdatamining.com/examples/association-rules k-means clustering https://www.r-bloggers.com/clustering-search-keywords-using-k-means-clustering/ LDA Topic modeling A gentle introduction to topic modeling […]

Everyday R code (13)

November 11, 2016 lilo 0

If the data set regular have 2 columns ‘ID’ and ‘Answer’, but the ‘ID’ is not unique. That means one ID can have 2 or […]

Everyday R code (12)

November 10, 2016 lilo 0

################################### ####Writing data into excel function######### ################################### #Method one # Write the first data set in a new workbook write.xlsx(Data1, file=”exportedata.xlsx”,sheetName=”USA-ARRESTS”, append=FALSE) # Add a second […]

Everyday R code (11)-Association rule/Market basket

October 16, 2016 lilo 0

##Association rule or Market basket library(“arules”) removewords=c(names(termFrequency)[which(termFrequency==1)],’en’,’f’,’nicht’,’es’,’luck’,’giving’,’thought’,’value’,’indeed’,’almost’,’apparently’,’exist’,’d’,’net’,’ture’,’dans’,’des’,’et’,’ne’,’une’,’le’) VerbList=sapply(DATA_.input, function(x){strsplit(x[[1]],’ ‘)}) VerbList=sapply(VerbList, function(x){ Idx=which(x==”” | x %in% removewords) if(length(Idx)>0)x=x[-Idx] else x=x x=unique(x)} ) VerbList=sapply(VerbList,function(x){ paste(x,collapse=’,’)}) temp=which(VerbList==”) […]

Everyday R code (9)

October 16, 2016 lilo 0

# word cloud is easy #we need cleanDescription.r file as follows. It was used to write some similar words into one word. For example, write […]