rlang

curly curly Tidy evaluation and modifying inputs or their names

核能气质少年 提交于 2020-08-22 14:34:42
问题 The new curly curly method of tidy evaluation is explained in this article. Several examples are given demonstrating the use of this style of non-standard evaluation (NSE). library(tidyverse) # Example 1 -------------------------- max_by <- function(data, var, by) { data %>% group_by({{ by }}) %>% summarise(maximum = max({{ var }}, na.rm = TRUE)) } starwars %>% max_by(height) starwars %>% max_by(height, by = gender) # Example 2 -------------------------- summarise_by <- function(data, ..., by

rlang, fpp3 R package: Error: `vars` must be a character vector upon calling aggregate_key()

╄→尐↘猪︶ㄣ 提交于 2020-06-28 06:40:29
问题 I'm working through the Hyndman fpp3 package based on this markdown document. https://github.com/robjhyndman/ISI_Workshop_2019/blob/master/5_reconciliation/reconciliation.Rmd I just couldn't find out why the following code fail to run PBS %>% aggregate_key(ATC1/ATC2, Scripts = sum(Scripts)) %>% filter(Month == yearmonth("1991 Jul")) %>% print(n=18) I keep receiving the following error each time I run the above. New names: * `` -> ...1 * `` -> ...2 * `` -> ...3 * `` -> ...4 * `` -> ...5 * ...