Closed dan-reznik closed 6 years ago
Related to #67
Julia I don't think it's related to that other Issue which is about non-standard column names. In my case it's related to non-compatibility with the latest dplyr 0.7.* capabilities for creating parametric functions.
I had originally posted this Issue on the dplyr github page but the author told me the issue was that tidytext is still not a tidyeval library.
Does that make sense?
Yep, makes sense! I'm pretty sure both issues will be solved by adding tidyeval to our package.
That's great! Any chance this could be done soonish...
Probably not this weekend but it is a priority.
We now have support for rlang/tidyeval in tidytext!
library(tidyverse)
library(tidytext)
df <- tribble(~id,~descr,1,"hello bug",2,"goodbye bug")
myFn <- function(df, col1,col2) {
col1 <- enquo(col1)
col2 <- enquo(col2)
df %>%
select(!!col1, !!col2) %>%
unnest_tokens(word, !!col2)
}
myFn(df, id, descr)
#> # A tibble: 4 x 2
#> id word
#> <dbl> <chr>
#> 1 1 hello
#> 2 1 bug
#> 3 2 goodbye
#> 4 2 bug
Thanks for using our package; let me know if you run into any problems with implementing tidyeval solutions with it.
I'm reopening this as a reminder to myself to update the rest of tidytext's functions.
thank you julia! looking fwd to using it
dan
On Mon, Sep 4, 2017 at 5:23 PM, Julia Silge notifications@github.com wrote:
We now have support for rlang/tidyeval in tidytext!
library(tidyverse) library(tidytext) df <- tribble(~id,~descr,1,"hello bug",2,"goodbye bug") myFn <- function(df, col1,col2) { col1 <- enquo(col1) col2 <- enquo(col2) df %>% select(!!col1, !!col2) %>% # works unnest_tokens(word, !!col2) # this won't work }
myFn(df, id, descr)#> # A tibble: 4 x 2#> id word#>
#> 1 1 hello#> 2 1 bug#> 3 2 goodbye#> 4 2 bug Thanks for using our package; let me know if you run into any problems with implementing tidyeval solutions with it.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/juliasilge/tidytext/issues/74#issuecomment-327024067, or mute the thread https://github.com/notifications/unsubscribe-auth/APeqlvADT969lm5GHpkgmjnBtz3rrK1Jks5sfFxKgaJpZM4OfTE3 .
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
loads required libraries
creates to 2-row tibble, test simple operation (it works)
creates a parametrized dplyr 0.7.* version of the above
Call to myFn below pukes at unnest_tokens()