Questions tagged [tidyeval]

Please use this tag for questions about using tidy evaluation within the tidyverse framework. For more information please refer to this handbook: https://tidyeval.tidyverse.org/

473 questions
0
votes
1 answer

Tidying text in a way compatible with tidy evaluation

I want to tidy up source code in a way that is compliant with tidy evaluation. Unfortunately, formatR does not preserve the !! operator. formatR::tidy_source(text = "!!little_b", output = FALSE)$text.tidy ## [1] "!(!little_b)" From Section 7 of…
landau
  • 5,636
  • 1
  • 22
  • 50
0
votes
1 answer

Unquoting inside of map2 with tidyeval

I'm creating a function that calculates the number of "runs" or missing or complete data - I want this to work with dplyr::group_by, so I have written this as an S3 method - below is a simplified example of this code. Unfortunately I find that the…
Nick Tierney
  • 192
  • 1
  • 8
0
votes
1 answer

group_by with non-scalar character vectors using tidyeval

Using R 3.2.2 and dplyr 0.7.2 I'm trying to figure out how to effectively use group_by with fields supplied as character vectors. Selecting is easy I can select a field via string like this (function(field) { mpg %>% dplyr::select(field)…
Robin Gertenbach
  • 10,316
  • 3
  • 25
  • 37
0
votes
3 answers

Forwarding expressions in dots after manipulation while capturing environment

I have a function fun_1 that utilizes substitute() on its ... argument, and another function fun_2 with signature fun_2(...) that implements the pattern do.call(fun_1, dots). I want fun_1() inside fun_2() to see the ... passed to fun_2(). Here's an…
kevinykuo
  • 4,600
  • 5
  • 23
  • 31
-1
votes
2 answers

How do I use tidyeval in R to create a small prediction dataset that has all levels of factors?

I am trying to obtain a prediction grid using the modelr::data_grid() function that has all levels for one factor of a model and only the "typical" level for the other factor in a model. The wrinkle is that the call levels() on the factor held…
-2
votes
1 answer

Use value inside variable in dplyrs left_join

I have a variable like this: name = "ID" and i want to use the value ("ID") to join a dataframe to another like this: left_join(df1, df2, by=c(name = "col_to_join") but I again don't know how to do this :/ with a little example a = mtcars %>% …
Lenn
  • 1,283
  • 7
  • 20
-2
votes
1 answer

Using NSE enquo with dply and tidyr (issue with complete(nesting(...), ...)

I'm trying to use the NSE with dplyr and tidyr. I have a list of product, their volume per month per region. The products and regions have hierarchical structure (ProductLevel1 coarser than ProductLevel2 coarser than Product Level3 ...). Before…
Fabien N.
  • 35
  • 5
1 2 3
31
32