run_query | R Documentation |
Once we have selected the facts, dimensions and defined the conditions on the instances, we can execute the query to obtain the result.
run_query(dq, unify_by_grain = TRUE)
## S3 method for class 'dimensional_query'
run_query(dq, unify_by_grain = TRUE)
dq |
A |
unify_by_grain |
A boolean, unify facts with the same grain. |
As an option, we can indicate if we do not want to unify the facts in the case of having the same grain.
A dimensional_query
object.
Other query functions:
dimensional_query()
,
filter_dimension()
,
select_dimension()
,
select_fact()
ms <- dimensional_query(ms_mrs) |>
select_dimension(name = "where",
attributes = c("city", "state")) |>
select_dimension(name = "when",
attributes = c("when_happened_year")) |>
select_fact(
name = "mrs_age",
measures = c("n_deaths"),
agg_functions = c("MAX")
) |>
select_fact(
name = "mrs_cause",
measures = c("pneumonia_and_influenza_deaths", "other_deaths")
) |>
filter_dimension(name = "when", when_happened_week <= "03") |>
filter_dimension(name = "where", city == "Boston") |>
run_query()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.