| data_round | R Documentation |
Round and format specified numeric columns in a data frame to a fixed number of decimal places.
data_round(data, cols, digits)
data |
A data frame or tibble. |
cols |
A tidyselect expression specifying which columns to round
(e.g., |
digits |
Integer; number of decimal places to round. |
For each selected numeric column:
The column is rounded using round().
It is then formatted as a character vector with a fixed number of
decimal places using sprintf().
Missing values (NA) are preserved as NA_character_.
Original non-essential attributes (except class and
levels) are restored.
The input data frame, with the specified numeric columns rounded and formatted as character vectors.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.