Commit ea3ff7fc authored by Holger Brandl's avatar Holger Brandl

reenabled set_names because it's better than purrr::set_names

parent 9b213795
...@@ -198,17 +198,16 @@ push_left <- function(df, pushColNames){ ...@@ -198,17 +198,16 @@ push_left <- function(df, pushColNames){
#http://astrostatistics.psu.edu/datasets/R/html/base/html/formals.html #http://astrostatistics.psu.edu/datasets/R/html/base/html/formals.html
## disabled because purrr::set_names does the same and even has the same name ## conflicts with purrr::set_names but does not work with ....
# set_names <- function(df, ...){ set_names <- function(df, ...){
# #browser() newnames <- as.character(unlist(list(...)))
# newnames <- as.character(unlist(list(...)))
# ## automatically convert matrices to data.frames (otherwise the names set would fail
# ## automatically convert matrices to data.frames (otherwise the names set would fail if(is.matrix(df)) df %<>% as.data.frame()
# if(is.matrix(df)) df %<>% as.data.frame()
# names(df) <- newnames;
# names(df) <- newnames; return(df)
# return(df) }
# }
# iris %>% purrr::set_names(paste(names(iris), "__")) %>% glimpse # iris %>% purrr::set_names(paste(names(iris), "__")) %>% glimpse
# iris %>% set_names(paste(names(iris), "__")) %>% glimpse # iris %>% set_names(paste(names(iris), "__")) %>% glimpse
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment