spq_offset: Offset the first generated result

View source: R/spq_offset.R

spq_offsetR Documentation

Offset the first generated result

Description

Offset the first generated result

Usage

spq_offset(.query, n = 5)

Arguments

.query

a list with elements of the query

n

the maximum number of lines to return

Value

A query object

Subsetting

spq_offset() and spq_head() are only useful when used with spq_arrange() that makes the order of results predictable.

Examples

# Return 42 items
spq_init() %>%
spq_add("?item wdt:P31 wd:Q5") %>%
spq_label(item) %>%
spq_add("?item wdt:P19/wdt:P131* wd:Q60") %>%
spq_add("?item wikibase:sitelinks ?linkcount") %>%
spq_arrange(desc(linkcount)) %>%
spq_head(n=42)

# Return 42 items after the first 11 items
spq_init() %>%
spq_add("?item wdt:P31 wd:Q5") %>%
spq_label(item) %>%
spq_add("?item wdt:P19/wdt:P131* wd:Q60") %>%
spq_add("?item wikibase:sitelinks ?linkcount") %>%
spq_arrange(desc(linkcount)) %>%
spq_head(42) %>%
spq_offset(11)

lvaudor/glitter documentation built on Jan. 30, 2024, 1:34 a.m.