business-science / tidyquant

Bringing financial analysis to the tidyverse
https://business-science.github.io/tidyquant/
Other
852 stars 175 forks source link

Pivot Tables - Error: `expr` must quote a symbol, scalar, or call #154

Closed herbivores closed 4 years ago

herbivores commented 4 years ago

Hi, i run the following code as described in https://www.business-science.io/finance/2020/02/26/r-for-excel-users.html

devtools::install_github("business-science/tidyquant")

Load the following libraries.

library(tidyverse) library(tidyquant) library(knitr)

When i run the following code i receive:

Pivot Tables

FANG %>% pivot_table( .columns = symbol, .values = ~ SUM(is.na(adjusted)) ) %>% kable()

FANG %>% pivot_table( .rows = c(symbol, ~ QUARTER(date)), .columns = ~ YEAR(date), .values = ~ (LAST(adjusted) - FIRST(adjusted)) / FIRST(adjusted) ) %>% kable()

I receive the following error message and attached backtrace

Error: expr must quote a symbol, scalar, or call Call rlang::last_error() to see a backtrace

message: `expr` must quote a symbol, scalar, or call class: `rlang_error` backtrace: 1. tidyquant::pivot_table(., .columns = symbol, .values = ~SUM(is.na(adjusted))) 8. rlang::quo_name(.) 9. rlang::expr_name(quo_squash(quo)) 16. rlang::switch_type(...) 17. tidyquant::pivot_table(., .columns = symbol, .values = ~SUM(is.na(adjusted))) 18. rlang::quo_name(.) Best Johan
mdancho84 commented 4 years ago

I'm not able to reproduce this issue. Are you still having the issue? I'm closing & we can reopen if you are still having.