- Download BLS Educational Attainment data by creating a temporary file and use the
read_excel() function from the readxl library to read in the data with the arguments sheet = 'Attainment', skip = 1).
bls_data_str <- "https://www.bls.gov/emp/ind-occ-matrix/education.xlsx"
- Use the New York Times API to search for articles related to higher education. Paste together the article key and url using
str_c, save it as an object with a name such as ‘article_key_and_url’. Then use fromJSON with that article key and url object as the input. Save it as an object called ‘req’.
article_key <- "&api-key=b75da00e12d54774a2d362adddcc9bef"
url <- "http://api.nytimes.com/svc/search/v2/articlesearch.json?q=higher+education"
# Your code
articles <- req$response$docs
data.frame(articles$headline, articles$web_url)