Commit 89b15e70 authored by Holger Brandl's avatar Holger Brandl

better matrix support for set_name

parent 1c8bd928
......@@ -127,6 +127,10 @@ push_left <- function(df, pushColNames){
set_names <- function(df, ...){
#browser()
newnames <- as.character(unlist(list(...)))
## automatically convert matrices to data.frames (otherwise the names set would fail
if(is.matrix(df)) df %<>% as.data.frame()
names(df) <- newnames;
return(df)
}
......
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