Skip to contents

Transform attributes into measures.

Usage

transform_to_measure(ft, attributes, k_sep, decimal_sep)

# S3 method for flat_table
transform_to_measure(ft, attributes, k_sep = NULL, decimal_sep = NULL)

Arguments

ft

A flat_table object.

attributes

A vector of strings, attribute names.

k_sep

A character, thousands separator to remove.

decimal_sep

A character, new decimal separator to use, if necessary.

Value

ft A flat_table object.

Details

We can indicate a thousands indicator to remove and a decimal separator to use. The only decimal separators considered are "." and ",".

Examples


ft <- flat_table('iris', iris) |>
  transform_to_attribute(measures = "Sepal.Length", decimal_places = 2) |>
  transform_to_measure(attributes = "Sepal.Length", decimal_sep = ".")