Learn R Programming

rolap (version 2.5.1)

filter_dimension: Filter dimension

Description

Allows you to define selection conditions for dimension rows.

Usage

filter_dimension(sq, name, ...)

# S3 method for star_query filter_dimension(sq, name = NULL, ...)

Value

A star_query object.

Arguments

sq

A star_query object.

name

A string, name of the dimension.

...

Conditions, defined in exactly the same way as in dplyr::filter.

Details

Conditions can be defined on any attribute of the dimension (not only on attributes selected in the query for the dimension). The selection is made based on the function dplyr::filter. Conditions are defined in exactly the same way as in that function.

See Also

Other query functions: as_GeoPackage(), as_geolayer(), get_layer(), get_variable_description(), get_variables(), run_query(), select_dimension(), select_fact(), set_layer(), set_variables(), star_query()

Examples

Run this code

sq <- mrs_db |>
  star_query() |>
  filter_dimension(name = "when", week <= " 3") |>
  filter_dimension(name = "where", city == "Cambridge")

Run the code above in your browser using DataLab