Skip to content

re-export purr::compose() as %o%? #10

@rpruim

Description

@rpruim

This could be useful for things like

df_stats( ~ BMI, data = NHANES, confint %o% t.test)

But apparently it would take some jiggering to make it actually work:

f <- confint %o% t.test
df_stats( ~ BMI, data = NHANES, f)
##   mean of x    lower    upper level
## 1  26.66014 26.51282 26.80745  0.95
## Warning message:
## Excluding 366 rows due to missing data [df_stats()]. 

df_stats( ~ BMI, data = NHANES, purrr::compose(confint, t.test))
## Error in FUN(X[[i]], ...) : 
##   'list(...)[[1L]]' is not a function, character or symbol
##  Error in FUN(X[[i]], ...) : 
##   'list(...)[[1L]]' is not a function, character or symbol 

df_stats( ~ BMI, data = NHANES, confint %o% t.test)
## Error in `%o%`(., confint, t.test) : unused argument (t.test)
##  Error in `%o%`(., confint, t.test) : unused argument (t.test) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions