get_similar_attribute_values.flat_table {rolap}R Documentation

Get similar attribute values combination

Description

Get sets of attribute values that differ only by tildes, spaces, or punctuation marks, for the combination of the given set of attributes. If no attributes are indicated, they are all considered together.

Usage

## S3 method for class 'flat_table'
get_similar_attribute_values(
  db,
  name = NULL,
  attributes = NULL,
  exclude_numbers = FALSE,
  col_as_vector = NULL
)

get_similar_attribute_values(
  db,
  name,
  attributes,
  exclude_numbers,
  col_as_vector
)

## S3 method for class 'star_database'
get_similar_attribute_values(
  db,
  name = NULL,
  attributes = NULL,
  exclude_numbers = FALSE,
  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.

exclude_numbers

A boolean, exclude numbers from comparison.

col_as_vector

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

Details

For star databases, a list of dimensions can be indicated, otherwise it considers all dimensions. If a dimension is indicated, a list of attributes to be considered in it can also be indicated.

You can indicate that the numbers are ignored to make the comparison.

If a name is indicated in the col_as_vector parameter, it includes a column with the data in vector form to be used in other functions.

Value

A vector of tibble objects with similar instances.

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_individually.flat_table(), get_unique_attribute_values.flat_table(), replace_attribute_values.flat_table(), set_attribute_names.flat_table(), set_measure_names.flat_table(), snake_case.flat_table()

Examples


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

db <- star_database(mrs_cause_schema, ft_num)
db$dimensions$where$table$City[2] <- " BrId  gEport "
instances <- db |>
  get_similar_attribute_values("where")

db <- star_database(mrs_cause_schema, ft_num)
db$dimensions$where$table$City[2] <- " BrId  gEport "
instances <- db |>
  get_similar_attribute_values("where",
    attributes = c("City", "State"),
    col_as_vector = "As a vector")

ft <- flat_table('iris', iris)
ft$table$Species[20] <- "se.Tosa."
ft$table$Species[60] <- "Versicolor"
instances <- ft |>
  get_similar_attribute_values()


[Package rolap version 2.5.1 Index]