tidyup_df | R Documentation |
Identifies columns that can be coerced to numeric in a data frame, transforms these columns to numeric and round them to the specified digits. It also replaces NA and NaNs values by blank.
tidyup_df(df = c(), digits = 3)
df |
Data frame |
digits |
Integer indicating the number of decimal places (round) or significant digits (signif) to be used |
Data frame with all possible columns as numeric and rounded to the specified number of digits
Jairo H Migueles
# Test data frame
df = data.frame(a = c("a", "b"), b = as.character(c(1.543218, 8.216856483)))
tidyup_df(df = df, digits = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.