Running examples in ‘tidyquant-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: excel_if_functions
> ### Title: Excel Summarising "If" Functions
> ### Aliases: excel_if_functions SUM_IFS COUNT_IFS AVERAGE_IFS MEDIAN_IFS
> ###   MIN_IFS MAX_IFS CREATE_IFS
> 
> ### ** Examples
> 
> library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
✔ ggplot2 3.3.0     ✔ purrr   0.3.4
✔ tibble  3.0.1     ✔ dplyr   0.8.5
✔ tidyr   1.0.3     ✔ stringr 1.4.0
✔ readr   1.3.1     ✔ forcats 0.5.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ lubridate::as.difftime() masks base::as.difftime()
✖ lubridate::date()        masks base::date()
✖ dplyr::filter()          masks stats::filter()
✖ dplyr::first()           masks xts::first()
✖ lubridate::intersect()   masks base::intersect()
✖ dplyr::lag()             masks stats::lag()
✖ dplyr::last()            masks xts::last()
✖ lubridate::setdiff()     masks base::setdiff()
✖ lubridate::union()       masks base::union()
> library(tidyquant)
> library(stringr)
> library(lubridate)
> 
> # --- Basic Usage ---
> 
> SUM_IFS(x = 1:10, x > 5)
[1] 40
> 
> COUNT_IFS(x = letters, str_detect(x, "a|b|c"))
[1] 3
> 
> SUM_IFS(-10:10, x > 8 | x < -5)
[1] -21
> 
> # Create your own IFS function (Mind blowingly simple)!
> Q75_IFS <- CREATE_IFS(.f = quantile, probs = 0.75, na.rm = TRUE)
> Q75_IFS(1:10, x > 5)
75% 
  9 
> 
> # --- Usage with tidyverse ---
> 
> # Using multiple cases IFS cases to count the frequency of days with
> # high trade volume in a given year
> FANG %>%
+     group_by(symbol) %>%
+     summarise(
+         high_volume_in_2015 = COUNT_IFS(volume,
+                                         year(date) == 2015,
+                                         volume > quantile(volume, 0.75))
+     )
# A tibble: 4 x 2
  symbol high_volume_in_2015
  <chr>                <int>
1 AMZN                    62
2 FB                      15
3 GOOG                    19
4 NFLX                    54
> 
> # Count negative returns by month
> FANG %>%
+     mutate(symbol = as_factor(symbol)) %>%
+     group_by(symbol) %>%
+ 
+     # Collapse from daily to FIRST value by month
+     summarise_by_time(
+         .date_var  = date,
+         .by        = "month",
+         adjusted   = FIRST(adjusted)
+     ) %>%
+ 
+     # Calculate monthly returns
+     group_by(symbol) %>%
+     mutate(
+         returns = PCT_CHANGE(adjusted, fill_na = 0)
+     ) %>%
+ 
+     # Find returns less than zero and count the frequency
+     summarise(
+         negative_monthly_returns = COUNT_IFS(returns, returns < 0)
+     )
Error in bquote(on.exit({ : 'where' must be an environment
Calls: %>% ... as_factor -> <Anonymous> -> eval_bare -> exit_handler -> bquote
Execution halted