Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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)
Comment

PREVIOUS NEXT
Code Example
Cpp :: eosio check account exist 
Cpp :: c++ pi 
Cpp :: qt remove resize handle 
Cpp :: you wanna import math on c++ 
Cpp :: loop through map c++ 
Cpp :: angle to vector2 godot 
Cpp :: qt qlcdnumber change value 
Cpp :: what is difference between single inverted and double inverted in programming languages 
Cpp :: cv2.threshold c++ 
Cpp :: gmod hitman job code 
Cpp :: watermelon codeforces solution 
Cpp :: precision of fixed in c++ 
Cpp :: non stoichiometric nacl is yellow 
Cpp :: modf() c++ 
Cpp :: set cmd size c++ 
Cpp :: c++ compare strings ignore case 
Cpp :: c++ in linux 
Cpp :: c ++ program to search hashmap 
Cpp :: PI IN C++ WITH CMATH 
Cpp :: c++ virtual function in constructor 
Cpp :: function as argument in another function in c++ 
Cpp :: how to hide the c++ console 
Cpp :: c++ file exists 
Cpp :: c++ int to string 
Cpp :: c++ evaluate expression 
Cpp :: Appending a vector to a vector in C++ 
Cpp :: allow cross origin 
Cpp :: how to make a random number in c++ 
Cpp :: for loop with array c++ 
Cpp :: search a word in cpp file 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =