Skip to contents

Summarise each group of results to fewer results

Usage

spq_summarise(.query, ...)

spq_summarize(.query, ...)

Arguments

.query

a list with elements of the query

...

variables by which to arrange (or SPARQL strings escaped with spq(), or strings, see examples)

Value

A query object

Examples

result = spq_init() %>%
spq_add("?item wdt:P361 wd:Q297853") %>%
spq_add("?item wdt:P1082 ?folkm_ngd") %>%
spq_add("?area wdt:P31 wd:Q1907114") %>%
spq_label(area) %>%
spq_add("?area wdt:P527 ?item") %>%
spq_group_by(area, area_label)  %>%
spq_summarise(total_folkm = sum(folkm_ngd))