Commit 5643f580 authored by Holger Brandl's avatar Holger Brandl

unboxing for set_names

parent 4567aff3
...@@ -123,11 +123,15 @@ push_left <- function(df, pushColNames){ ...@@ -123,11 +123,15 @@ push_left <- function(df, pushColNames){
} }
set_names <- function(df, newnames){ #http://astrostatistics.psu.edu/datasets/R/html/base/html/formals.html
df<- as.df(df) set_names <- function(df, ...){
#browser()
newnames <- as.character(unlist(list(...)))
names(df) <- newnames; names(df) <- newnames;
return(df) 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() 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 } ...@@ -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 ## related: http://cran.r-project.org/web/packages/R.cache/R.cache.pdf
......
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