View source: R/flat_table_transform.R
| transform_attribute_format | R Documentation |
Transforms numeric attributes adapting their format as indicated.
transform_attribute_format(
ft,
attributes,
width,
decimal_places,
k_sep,
decimal_sep,
space_filling
)
## S3 method for class 'flat_table'
transform_attribute_format(
ft,
attributes,
width = 1,
decimal_places = 0,
k_sep = NULL,
decimal_sep = NULL,
space_filling = TRUE
)
ft |
A |
attributes |
A vector of strings, attribute names. |
width |
An integer, string length. |
decimal_places |
An integer, number of decimal places. |
k_sep |
A character, thousands separator used (It can not be changed). |
decimal_sep |
A character, decimal separator used (It can not be changed). |
space_filling |
A boolean, fill on the left with spaces (with '0' otherwise). |
If a number > 1 is specified in the width parameter, at least that length
will be obtained in the result, padded with blanks on the left.
ft A flat_table object.
flat_table
Other flat table transformation functions:
add_custom_column(),
remove_instances_without_measures(),
replace_empty_values(),
replace_string(),
replace_unknown_values(),
select_attributes(),
select_instances(),
select_instances_by_comparison(),
select_measures(),
separate_measures(),
transform_from_values(),
transform_to_attribute(),
transform_to_measure(),
transform_to_values()
ft <- flat_table('iris', iris) |>
transform_to_attribute(measures = "Sepal.Length", decimal_places = 2) |>
transform_attribute_format(
attributes = "Sepal.Length",
width = 5,
decimal_places = 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.