We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
values_fn
values_transform
library(dbplyr) lazy_frame(x = 1) %>% tidyr::pivot_longer(x, values_transform = list(value = as.character)) #> <SQL> #> SELECT 'x' AS `name`, CAST(`x` AS TEXT) AS `value` #> FROM `df` lazy_frame(x = 1) %>% tidyr::pivot_longer(x, values_transform = list(value = ~ as.character(.x))) #> Error: Result 1 must be a single string, not NULL of length 0 spec1 <- tibble::tibble(.name = "x", .value = "val", key = "x") lazy_frame(a = c(1, 1, 2), key = c("x", "x", "x"), val = c(1, 10, 100)) %>% dbplyr:::dbplyr_pivot_wider_spec(spec1, values_fn = sum) #> <SQL> #> SELECT `a`, SUM(CASE WHEN (`key` = 'x') THEN (`val`) END) AS `x` #> FROM `df` #> GROUP BY `a` lazy_frame(a = c(1, 1, 2), key = c("x", "x", "x"), val = c(1, 10, 100)) %>% dbplyr:::dbplyr_pivot_wider_spec(spec1, values_fn = ~ sum(.x, na.rm = TRUE)) #> Error: Can't convert NULL to a string
Created on 2022-01-05 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered:
pivot_*()
Successfully merging a pull request may close this issue.
Created on 2022-01-05 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: