From 5643f580cfdd57638ed8b03f5f355ffd3775ea3b Mon Sep 17 00:00:00 2001 From: Holger Brandl Date: Fri, 24 Apr 2015 14:01:06 +0200 Subject: [PATCH] unboxing for set_names --- R/core_commons.R | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/R/core_commons.R b/R/core_commons.R index e408d5a..e5d53ad 100644 --- a/R/core_commons.R +++ b/R/core_commons.R @@ -123,11 +123,15 @@ push_left <- function(df, pushColNames){ } -set_names <- function(df, newnames){ - df<- as.df(df) +#http://astrostatistics.psu.edu/datasets/R/html/base/html/formals.html +set_names <- function(df, ...){ +#browser() + newnames <- as.character(unlist(list(...))) names(df) <- newnames; return(df) } +#iris %>% set_names(c("setosa", "hallo")) %>% head +#iris %>% set_names("setosa", "hallo") %>% head head_html <- function(df, n=5) head(df, n) %>% knitr::kable(format="html") %>% print() @@ -165,7 +169,7 @@ replaceNA <- function(x, withValue) { x[is.na(x)] <- withValue; x } ######################################################################################################################## -#### Result Caching for long running +#### Result Caching for long running tasks ## related: http://cran.r-project.org/web/packages/R.cache/R.cache.pdf -- GitLab