The with_namer
is simply a mixin class that gives a function a namer
attribute. We could probably abstract this to a mixin
package. A mixin:
This does not work:
```R library(na.tools) f <- . %>% na_omit %>% median f2 <- set_namer(f) "foo" %>% name_it(f2) # "foo.na_omit"
It gives the name `foo.na.omit` but should be smart enough to provide `foo.median` or `foo.na_omit.median`. A solution may be to have the name taken from each function in the pipe: - `na.omit` would not provide a `namer` function so it is passed through identically - `median` would add suffix ".median" This would: "foo" %>% identity %>% name_it("median") This would extract the names from the pipe ```r lapply( functions(f), . %>% body %>% extract2(1) ) %>% unlist %>% as.character() %>% paste( collapse=".")
There might even be verbose mode in which na_omit
would not be used if omitted
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.