TODO

This is a mixin / role

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:

Smarter Defaults from Pipes

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



decisionpatterns/nameit documentation built on Aug. 22, 2020, 4:18 a.m.