I'm very new in this world of programming.
Ok so I am making an analysis of a text in R. I am using this to get rid of stop words:
kant_palavras <- kant_palavras %>% anti_join(get_stopwords(language = 'pt'))
BUT after, in the counting of words, the most common is "no". This is not useful for my analysis and I want to remove it, but I do not know how to do it.
I tried
kant_palavras <- kant_palavras %>% anti_join("no")
and
palavras_a_remover <- c("no")
kant_palavras <- kant_palavras %>% anti_join(data.frame(palavra = palavras_a_remover))
and
palavras_a_remover <- c("no")
kant_palavras <- kant_palavras %>%
filter(!palavra %in% palavras_a_remover)
neither worked to get rid of that no!
--
full code before (all works):
dados_kant <- read.csv("kant2.csv")
dados_kant2 <- as_tibble(dados_kant)
Encoding(dados_kant2$texto.do.kant) <- "ASCII"
for (i in 1:nrow(dados_kant2))
{
dados_kant2$texto.do.kant[i] <- iconv(dados_kant2$texto.do.kant[i], to = "ASCII//TRANSLIT")
}
kant_palavras <- dados_kant2 %>% unnest_tokens(word, texto.do.kant)
kant_palavras <- kant_palavras %>% anti_join(get_stopwords(language = 'pt'))
You can do:
This would remove the entire row. If you only want to remove the word 'no', but keep the rest of the text, you can do: