gu_content: Content

Description Usage Arguments Value Fields options #' The following are the options for the show_tags parameter Examples

View source: R/content.R

Description

Query and return all available content in the API.

See the API docs for full details on the query options available for this content endpoint.

Usage

1
2
3
4
gu_content(query = NULL, show_fields = "all", show_tags = "all",
  tag = NULL, from_date = NULL, to_date = NULL,
  use_date = "published", ..., verbose = TRUE, tidy = TRUE,
  tidy_style = "snake_case")

Arguments

query

A string, containing the search query. Defaults to NULL, which returns all available content subject to other parameters. Supports AND, OR and NOT operators, and exact phrase queries using double quotes. E.g. '"football" OR "politics"'.

show_fields

A string or character vector of fields to include in the returned data. Defaults to "all". See details for a list of options.

show_tags

A string or character vector of tags to include in the returned data. Defaults to "all". See details for a list of options.

tag

A string or character vector of tags to filter the returned data. Defaults to NULL.

from_date

Accepts character values in 'YYYY-MM-DD' format, and objects of class Date, POSIXt, POSIXct, POSIXlt or anything else that can be coerced to a date with as.Date(). Defaults to NULL.

to_date

Accepts character values in 'YYYY-MM-DD' format, and objects of class Date, POSIXt, POSIXct, POSIXlt or anything else that can be coerced to a date with as.Date(). Defaults to NULL.

use_date

The date type to use for the from_date and to_date parameters. One of "published", "first-publication", "newspaper-edition" or "last-modified". Defaults to "published".

...

Use to pass any other parameters to the API. See the docs for a full list of options.

verbose

Prints messages to console. Defaults to TRUE.

tidy

Convert variable names to snake_case, remove some "<NA>" strings. Defaults to TRUE.

tidy_style

Style to variable names with.

Value

A tibble.

Fields options

The following are the options for the show_fields parameter:

#' The following are the options for the show_tags parameter

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
x <- gu_content(query = "films")

y <- gu_content(
  query = "relationships",
  from_date = "2018-11-30", to_date = "2018-12-30"
)

## End(Not run)

evanodell/guardianapi documentation built on Nov. 27, 2020, 9:13 a.m.