Horje
round all columns in R dataframe to 3 digits 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)




Cpp

Related
find all occurrences of a substring in a string c++ Code Example find all occurrences of a substring in a string c++ Code Example
check file exist cpp Code Example check file exist cpp Code Example
clear buffer memory in c / c++ Code Example clear buffer memory in c / c++ Code Example
void value not ignored as it ought to be Code Example void value not ignored as it ought to be Code Example
print hello world c++ Code Example print hello world c++ Code Example

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