Skip to contents

Get unique set of values for the given attributes. If no attributes are indicated, all are considered.

Usage

# S3 method for flat_table
get_unique_attribute_values(
  db,
  name = NULL,
  attributes = NULL,
  col_as_vector = NULL
)

get_unique_attribute_values(db, name, attributes, col_as_vector)

# S3 method for star_database
get_unique_attribute_values(
  db,
  name = NULL,
  attributes = NULL,
  col_as_vector = NULL
)

Arguments

db

A flat_table or star_database object.

name

A string, dimension name.

attributes

A vector of strings, attribute names.

col_as_vector

A string, name of the column to include a vector of values.

Value

A vector of tibble objects with unique instances.

Details

If we work on a star database, a dimension must be indicated.

Examples


instances <- star_database(mrs_cause_schema, ft_num) |>
  get_unique_attribute_values()

instances <- star_database(mrs_cause_schema, ft_num) |>
  get_unique_attribute_values(name = "where")

instances <- star_database(mrs_cause_schema, ft_num) |>
  get_unique_attribute_values("where",
    attributes = c("REGION", "State"))

instances <- flat_table('iris', iris) |>
  get_unique_attribute_values()