knitr::opts_chunk$set( eval = FALSE, collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", eval = FALSE ) options(width = 110) library(nyt)
Collecting nytimes data.
You can install {nyt} from Github with:
devtools::install_github("mkearney/nyt")
nyt_articles()
This is a basic example showing how to search for articles from the US
section:
## basic example code us1 <- nyt_articles(section = "us", page = 1) ## view data us1
And here is an example of fetching multiple pages of results from an article search of the world
section:
## get multiple pages w <- purrr::map(1:3, ~ nyt_articles(section = "world", page = .x)) ## merge and view data dplyr::bind_rows(w)
nyt_comments()
This is a basic example showing how to get the user/community comments associated with an article's URL:
## basic example code c1 <- nyt_comments(us1$url[9]) ## view data c1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.