filter_text: Remove words in dictionary from '"character"' string

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Remove words in dictionary from "character" string

Usage

1

Arguments

x

"character" string

d

dictionary of commonly used words in the English language (e.g., data("common_word_dictionary"))

Value

a vector of "character" strings excluding words found in common word dictionary

Examples

1
2
3
4
5
6
data("common_word_dictionary")
x <- "Hello, my name is Shan Sabri!   less common words are: cells, differentation, reprogramming"
x <- strip_punctuation(x)
dictionary <- as.vector(dictionary$V1[1:5000])
filter_text(x, d = dictionary)
# # [1] "shan"           "sabri"          "cells"          "differentation" "reprogramming"

ShanSabri/PubMedScrapeR documentation built on Oct. 30, 2019, 11:53 p.m.