| df.round | R Documentation |
This function rounds all numeric columns in a data frame.
df.round(data, ..., digits = 2, drop = FALSE, check = TRUE)
data |
a data frame. |
... |
an expression indicating the variable names in |
digits |
an integer value indicating the number of decimal places to be used. |
drop |
logical: if |
check |
logical: if |
Returns data frame data with numeric columns rounded to the number of
decimal places according to the argument 'digits'.
Takuya Yanagida takuya.yanagida@univie.ac.at
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
df.check, df.duplicated, df.unique,
df.head, df.tail, df.long,
df.wide, df.merge, df.move,
df.rbind, df.rename, df.sort,
df.subset
# Example 1: Round numeric columns with 0 digits
df.round(penguins, digits = 0)
# Example 2: Round numeric columns with 0 digits and drop non-numeric columns
df.round(penguins, digits = 0, drop = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.