Learn R Programming

rolap (version 2.5.1)

get_unique_attribute_values.flat_table: Get unique attribute values

Description

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 )

Value

A vector of tibble objects with unique instances.

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.

Details

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

See Also

star_database, flat_table

Other star database and flat table functions: get_attribute_names.flat_table(), get_measure_names.flat_table(), get_similar_attribute_values.flat_table(), get_similar_attribute_values_individually.flat_table(), replace_attribute_values.flat_table(), set_attribute_names.flat_table(), set_measure_names.flat_table(), snake_case.flat_table()

Examples

Run this code

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()

Run the code above in your browser using DataLab