Applying round off function on all sheets in a run in R -


thanks community, using following code round off numeric values in given data frame. take step further , automate function identifies imported dataframe ( not ones created in workflow) , round off numeric values in it. have run function every time import dataframe. round of function using

round_df <- function(df, digits) {     nums <- vapply(df, is.numeric, fun.value = logical(1))      df[, nums] <- round(df[, nums], digits = digits)      (df) } df <- round_df(df, digits = 2) 

is there way identify imported dataframe in environment? should use loop?

thank much.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -