My code is returning the word twice. Any reason for this?

The URL to my project is above. I'm having trouble retrieving the words found in each Corpus row. My code is below. The results just return the first word found.

Run this search by the algorithm for Peace Corp Data

search_res_PeaceCorp <- merge(search_dtPeaceCorp[, id:=1L], search_for[, id:=1L], by="id", allow.cartesian=TRUE)[,
match:=corpusPeaceCorp %like% word, by=.(corpusPeaceCorp, word, value)][
match==TRUE, .(words=paste(sort(word), collapse=", "), "Peace Corp Insider Word Score"=sum(value)), by=corpusPeaceCorp]

search_res_PeaceCorp <- merge(search_dtPeaceCorp[, -"id"], search_res_PeaceCorp, on="corpusPeaceCorp", all.x=TRUE)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.