Horje
how to round all numeric column types in r Code Example
round all columns in R dataframe to 3 digits
round_df <- function(x, digits) {
    # round all numeric variables
    # x: data frame 
    # digits: number of digits to round
    numeric_columns <- sapply(x, mode) == 'numeric'
    x[numeric_columns] <-  round(x[numeric_columns], digits)
    x
}

round_df(data, 3)
how to round all numeric column types in r
library(dplyr)
df %>% 
 mutate_if(is.numeric, round)




R

Related
mutual information in r Code Example mutual information in r Code Example
regex last word in string r Code Example regex last word in string r Code Example
ggplot box plot without outliers poins Code Example ggplot box plot without outliers poins Code Example
r alluvial chart with NA Code Example r alluvial chart with NA Code Example
how to get quantile summary statistics in r summarise Code Example how to get quantile summary statistics in r summarise Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7