assoc_word: Find associations in BBC News article

Description Usage Arguments Details Value Note Examples

View source: R/FindWordAssociations.R

Description

Find terms associated with the input word with at least input correlation value. Build a dataframe with terms and correlation values in decreasing order

Usage

1
assoc_word(url_end, word_entry, corr_entry)

Arguments

url_end

a character string, an ending part of BBC News particular atricle URL (everything after https://www.bbc.com/news/). For example, article URL is "https://www.bbc.com/news/world-us-canada-51381625". Only "world-us-canada-51381625" should be pasted

word_entry

character string, one input word to analyze associations (terms which correlate) with it

corr_entry

numeric, correlation value, should be between 0 and 1, otherwise user gets a message to run the function again (recommended value is between 0.3 and 0.6)

Details

It's recommended to check the dataframe with the most frequent term (run function analyze_text) to know which terms might be relevant for the analysis.

Value

assoc - a dataframe with two columns: terms correlated with word input and correlation value in decreasing order

Note

Please, check that URL (url_end) exists before running the function, otherwise you will get an "Error in open.connection(x, "rb") : HTTP error 404". Please, insert URLs of the articles in English only. Only for BBC News, not BBC Sports , Travel, Worklife, etc.

Examples

1
2
assoc_word("world-asia-51427301", "fire", 0.3)
assoc_word("world-us-canada-51408704", "trump", 0.5)

unimi-dse/1ed5ff0d documentation built on Feb. 10, 2020, 12:21 a.m.